jquery - Add a div in another div by id? -


i have created div:

<div id="mainbox"></div> <div id="div1" style="display:none;">lorem ipsum...</div> 

now want add div 'div1' in div 'mainbox':

$("#mainbox).append("#div1"). 

but doesn't work want, instead prints text #div1

try this:

$("#mainbox").append($("#div1")) 

with this, selecting #div1, way did it, appending string.

please note div hidden, try also:

$("#div1").show(); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -