denisoid
denisoid

Reputation: 163

jQuery attr() to ajax loaded content

I need set autocompete to off to all inputs, and use this:

$(":input").attr('autocomplete','off');

How calling this to ajax loaded inputs without setting attribute after ajax request? Maybe exist event, which can be placed into on() method?

Upvotes: 0

Views: 277

Answers (2)

pimvdb
pimvdb

Reputation: 154818

There is not something in the jQuery core to do this directly, but there is a plugin called livequery: http://jsfiddle.net/7seQb/1/.

​$(":input").livequery(function() {
    $(this).attr("autocomplete", "off");
});

Upvotes: 2

Viktor S.
Viktor S.

Reputation: 12815

I'm afraid there is no such event. But why don't you want set it after ajax request? Suppose it is because you do not want to update each ajax request. If so, you may use jQuery.ajaxComplete to do this in one place.

Upvotes: 0

Related Questions