Disallows passing attributes to the jQuery constructor. Prefer .attr
.
❌ Examples of incorrect code:
$( '<div>', { width: 100, class: 'foo' } );
$( '<div>', { on: { click: function () {} } } );
$( '<div/>', { data: { foo: 'bar' } } );
$div.add( '<div>', { width: 100, class: 'foo' } );
✔️ Examples of correct code:
$( '.div' );
$( '<div>' );
$( '.div', context );
$( '<div>', ownerDocument );
$( '<div/>', ownerDocument );
$div.add( '<div>', context );