When creating jQuery objects, I used the following syntax recently, as described here :
var $el = $('<div/>', {
class: 'class-1 class-2'
});
Safari 5.0.5 gives a syntax error at the point where I am using the above construct.
Removing the second argument and adding classes with addClass fixes the error, but seems rather inelegant.
How do you create your objects? I tried using attr ({class: 'class-1'}), but got the same syntax error.
source
share