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: '',
  4. id: 'someAwesomeID',
  5. rel: 'external',
  6. title: 'This is a title'
  7. }).appendTo('body');

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.