xxxxxxxxxx
var newDiv = $('<div>My new div</div>'); //create Div Element w/ jquery
$( "#someOtherElement" ).append(newDiv); //append new div somewhere
xxxxxxxxxx
// Creating a new div element
var newDiv = $("<div>");
// Adding some attributes or content to the element
newDiv.attr("id", "myDiv");
newDiv.html("This is a new div created dynamically!");
// Appending the new div to an existing element
newDiv.appendTo("#someContainer");
xxxxxxxxxx
var newDiv = $('<div>My new div</div>'); //create Div Element w/ jquery
$( "#someOtherElement" ).append(newDiv); //append new div somewhere
$('<div>hello</div>').appendTo('#parent');
xxxxxxxxxx
// Creating a new div element
var newDiv = $('<div></div>');
// Setting attributes to the div element
newDiv.attr('id', 'myDiv');
newDiv.attr('class', 'myClass');
// Appending the div element to the body
$('body').append(newDiv);
xxxxxxxxxx
// Example: Creating a new <div> element with a CSS class using jQuery
var newElement = $("<div>").addClass("myClass");