/ Published in: jQuery
Create an open and close h2
add the text, class
append to the article
add the text, class
append to the article
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('<h2></h2>', { text: 'Hello from js 2', class: 'myClass' }).appendTo('article');
URL: http://tutsplus.com/lesson/creating-and-appending-content/