-3
$("input:text,textarea").attr("autocomplete","off");

新しい要素がdomに追加されたときにそれを機能させるには、どのようなひねりがありますか。$(document).ready でルールが実行された後、新しく追加された要素にこのルールを適用するには、input:text と textarea に影響を与えます

完璧ではありませんが、これが答えです。

$(function() {
$("body").on("focus", "input:text,textarea", function(){
if($(this).attr("autocomplete")!="off"){
$(this).attr("autocomplete","off");
}
});
});

すべての反対票をありがとう..

4

1 に答える 1

1

I think the problem here is that the autocomplete is not a valid attribute for the input field.. It is added by the jQuery plugins .

You need to set the autocomplete to on and off using the plugin syntax for the jquery UI

于 2012-09-14T21:19:25.620 に答える