append an element with 'id'

just below is original html.
<div id='top'></div>

I want to append below
<div id='parent' style='height :20%'>
    <div id='child'></div>

how can I do this in jquery?
Who is Participating?
KhiluConnect With a Mentor Commented:
Use double quote for text that you want to append.

$('#top').append("<div id='parent' style='height :20%'><div id='child'>This is child</div> </div>");

Open in new window

MrunalConnect With a Mentor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.