My code is the following (also available at jsfiddle):
$button = $('<button />', {
text: 'my button',
class: 'button'
});
The jslint error message is:
Problem at line 3 character 5: Expected an identifier and instead saw 'class' (a reserved word).
class: 'button'
Class is a reserved word for Javascript 2.0, thus you should not use it as a key in an object without putting it between quotes to mark it as a string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With