JQuery · Startups

Which is the correct or better way to create a new element with jQuery?

Satvinder Singh Web and Graphic Designer at Designer ios

October 3rd, 2016

I consider myself a rookie when it comes down to programming. Thanks a lot for the thoughtful responses in advance.
A great idea is 1% of the work. Execution is the other 99%. In this course, we’ll teach you how to conduct market analysis, create an MVP and pivot (if needed), launch your business, survey customers, iterate your product/service based on feedback, and gain traction quickly.

Alexander Conroy

October 4th, 2016

I prefer var element = $('<element>'). It will create the element then you can just 

$('otherselector').append(element); You can also run anything you want on element before appending or prepending or whatever. Don't forget there are many different DOM insertion functions and you will have to choose where to insert!

Tom DiClemente Management Consulting | Interim CEO/COO | Coach

October 4th, 2016

Go to https://learn.jquery.com/using-jquery-core/manipulating-elements/ and scroll down to creating new elements.