I am generating a HTML element with an attribute via jQuery and then inserting it into the DOM. I am passing a class attribute into the element. See below:
jQuery('<li></li>', {
class: "myClass"
});
I am receiving the following error in ie7 and ie8, on the line with class: "myCLass".
SCRIPT1028: Expected identifier, string or number
It works in ie9 and Firefox. Haven't tested any other browsers.
Is this method of generating an element with attributes not supported in ie7 and ie8? Or am I making a mistake in my script?