Passing attributes for an object as the second argument to the jQuery function itself


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



Copy this code and paste it in your HTML
  1. $('', {
  2. text: 'jQuery is awesome!',
  3. href: 'http://www.jquery.com',
  4. id: 'someAwesomeID',
  5. rel: 'external',
  6. title: 'This is a title'
  7. }).appendTo('body');
  8.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.