I would really like to know what the following jquery line of code does:
$('input', f).add('textarea', f).add('select', f).change(enable).one('blur', function () {
//commands go here
});
Can somebody please explain to me the first line of code ?
That line takes every
input,textarea, andselectelement within some other jQuery object,f, and binds a change event handler, which is some function calledenable. Then, it hooks up an event to theonblurmethod of those objects that only gets executed at most one time.The line:
Is really just equivalent to:
Which selects the union of all of those elements within some context,
f. Then, check out the documentation for change() and one() for the full explanation.