131
rated 0 times
[
132]
[
1]
/ answers: 1 / hits: 15898
/ 10 Years ago, tue, september 2, 2014, 12:00:00
I have a problem with .click() event in jquery. I create an input tag with a button, and then when I click this tag it must show an alert message. But it doesn't work.
Here is the HTML code:
<div id=test>
</div>
<input type=button id=btn value=Submit />
And the Jquery code:
$(#btn).click(function(){
html = <input type='text' size='1' name='courses[]' value='1' />;
$(#test).after(html);
});
$(input[type='text']).on(click, function(){
alert('ppp');
});
All libraries of jquery are linked in the real site.
Here is an example in jsFiddle: http://jsfiddle.net/82pps6Lz/29/
Thanks
More From » jquery