Creating a div element in jQuery

How do I create a div element in jQuery?

Text Copied From
on : Fri, May 15, 2009 Views : 1463778

Accepted Answer

You can use append (to add at last position of parent) or prepend (to add at fist position of parent):


// or $('<div>hello</div>').appendTo('#parent');

Alternatively, you can use the .html() or .add() as mentioned in a different answer.

Text Copied From
on : Fri, May 15, 2009

Ask Question

If you want to ask question you must LogIn or SignUp
Login SignUp

Quick Links



Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..


Login to Open ESchool OR Create your account    Login   SignUp