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.
More than 65% of new companies fail because they lack funding. In this course, you’ll learn common fundraising mistakes, how to nail an elevator pitch, how to craft a killer pitch deck, where to source investments from, and all about term sheets and convertible notes.

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.