-1

When I click on #demo_3, it simply eliminates the button. However, if inside the replaceWith() I put a <p> O, hai! </p>, O, hai! will appear.

$(document).ready(function(){
  $("#demo_3").click(function(){
    $("#ind_3").replaceWith('<form action="newgoal.php" method="post"><input name="newgoal" type="text"></form>');

  });
});
Jacob
  • 77,566
  • 24
  • 149
  • 228

1 Answers1

0

I am not exactly sure what your question is, but if you are suggesting that the code you've posted won't replace #ind_3 I would say are wrong and your issue is somewhere else. You can see it functioning here:

http://jsfiddle.net/9rnRa/

Just to clarify: My answer is that you CAN replace #ind_3 with the HTML you are trying and if it's not working for you then you have another issue.

Abe Miessler
  • 82,532
  • 99
  • 305
  • 486