Hi there, total jquery noob here.
I'm having some trouble with the .append() method, though my problems might not be specific to this method.
First off, I'm trying to append some text within <p> tags. It works fine with small strings, but when I try to do a very long string, and return it on the next line so I don't have to scroll way to the right to read it in my code, the "" are broken up. For instance:
$("#btn1").click(function(){
$("#main").append("<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in</p>")
});
doesn't work. When I jump to the next line it doesn't recognize the quotations, so element is broken up and nothing prints.
I also tried the element an id, <p id="1"> down in the body. I then hide the element
$("#1").hide()
and try to append the element:
$("#btn1").click(function(){
$("#main").append("#1")
});
and it prints out "#1" instead of the text within <p id="1">text</p>