Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Create Content on the fly!

If you want to create content on the fly, you will have to use these functions most of the time.

$(element).append(anotherElement) => equivalent to appendChild

$(element).prepend(anotherElement) => Puts the child at the beginning of the element.

$(element).after(anotherElement) => Equivalent to insertAdjacentElement();

$(element).before(anotherElement) => Adds a sibling exactly before the element.

Inserting multiple html elements also possible!

$(element).append(firstElement, secondElement, thirdElement) => appends firstElement, secondElement, thirdElement);

 

Bear in mind: Still you have to create somehow the element from the beginning (with the createElement() function probably).