javascript - Change attributes of a DOM element when it appears -
is there way change attribute of dom element created? have input (has id) created plugin. need change placeholder of input when appears.
i.e.
$("#token-input_sample").live("attr","placeholder","place");
code above doesn't work.
on()
should used bind events elements exist now, or in future. manipulate properties or attributes of elements, should use prop()
function:
$('#token-input_sample').prop('placeholder', 'place');
Comments
Post a Comment