Fastest Web Hosting

what is the most efficient way to create html elements using jquery

0 votes
asked Aug 27, 2016 in Jquery by rajatinsa (3,350 points)

i am doing a lot of modal window pop-ups , for which I using jQuery. The method that I used to create the new elements on the page has overwhelmingly been along the lines of:

$("<div></div>");

but, I'm getting the feeling that this isn't the best or the most efficient method of doing this. so i want to another way to do this.

This answer has the benchmarks to the suggestions below.

1 Answer

0 votes
answered Sep 16, 2016 by arifshabbir (460 points)

var $element = $("<div> some text </div>");

append anywhere you want

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...