Joined December 2013
·

Thorin

Portugal
·
·

Posted to jQuery DOM creation tips over 1 year ago

"As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset." -- http://api.jquery.com/jquery/#jQuery-html-attributes

For example:


$('<img>', { 
    'class': 'avatar', 
    src: 'avatar.jpg', 
    css: {
         maxWidth: '300px', maxHeight: '300px',
         display: none
    },
    data: {
        capture: 'true'
   }
 })
</code></pre>
Achievements
59 Karma
0 Total ProTip Views