javascript - How to hide/show JS-generated content? -


i need hide/show javascript-generated content, see below:

$(window).load(function () {     $("body").html('<a href="# id="ipsum">show ipsum</a><br />' +         '<p id="lorem_content">lorem</p><p id="ipsum_content">ipsum</p>' +         '<p id="dolor_content">dolor</p>');     $("p").hide();     $("p#lorem_content").show();      $("a").live("click", function() {         $("p").hide();         $("p#" + $(this).attr('id') + "_content").show();     }); });​ 

http://jsbin.com/olebu3/edit

the content, should shows after clicking on a#ipsum not being shown... why? jquery hide() method should set content "display:none", not remove content, isn't true?

change <a href="# id="ipsum" <a href="#" id="ipsum" in second line. forgot quote


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -