I'm trying to create a CSS class with the following:
var not_cursor = $('<style>#NOT_CURSOR { CURSOR: NONE; BACKGROUND: URL("images/NOT1.png") NO-REPEAT LEFT TOP;
POSITION: ABSOLUTE;
DISPLAY: NONE;
TOP: 0;
LEFT: 0;
Z-INDEX: 10000;}</style>');
$('html > head').append(not_cursor);
And then in another file I try accessing $('#NOT_CURSOR') but I get an error -
Uncaught SyntaxError: Unexpected token ILLEGAL
And it's telling me this occurs on line 1. Any help?
Thanks.
$('head').append(not_cursor);? Also, the error is in line 1 because it comes from the element dynamically added to the DOM, not in the script. And also, are you trying to select a class#NOT_CURSORwith an ID selector$('#NOT_CURSOR')?