Wednesday, 21 August 2013

add html in jquery and use jquery on new html

add html in jquery and use jquery on new html

i am trying to add html using jquery and than i want to do actions
according to the new added html. Here is the example what i am trying to
do..
This is my html
<div id='area'></div>
i use this jquery command to add html in this section
$("#area").html('<p id="mynewid">my text</p>');
now i want to add text in p tag and i used this command
$("#mynewid").click(function() {
$(this).html("my 2nd new text");
});
But it's not working...

No comments:

Post a Comment