javascript - Write something inside input id tag with jquery -


i have this:

<input name="input_2" id="input_1_2" type="text" value="" class="medium" tabindex="1"> 

and want jquery write in html code:

<input name="input_2" id="input_1_2" onblur="myfunction()" type="text" value="" class="medium" tabindex="1"> 

with this:

$('#input_1_2').blur(function(){myfunction();}); 

it's working, if see html code, onblur="myfunction()" nothing on html code, , written on html code jquery. (need written in jquery or javascript).

thanks help!

$('#input_1_2').attr('onblur', 'myfunction()');

i should reference fact jquery isn't changing original source: jquery dom changes not appearing in view source


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -