Create insert text


/ Published in: jQuery
Save to your folder(s)

Create an open and close h2
add the text, class
append to the article


Copy this code and paste it in your HTML
  1. $('<h2></h2>', {
  2. text: 'Hello from js 2',
  3. class: 'myClass'
  4. }).appendTo('article');

URL: http://tutsplus.com/lesson/creating-and-appending-content/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.