Search code examples
javascriptjquerygreasemonkeyuserscripts

jscript and jquery and Uncaught TypeError


I have userscript. I recentyly added jquery to it.

Before I added jquery that line was working:

document.getElementById("servertime").removeAttribute("id");

but now after I added jquery (jquery is working) this line gives me error that it is undefined. Why before jquery it was working and now it it not?


Solution

  • That is weird, but you can now use jQuery to do this:

    $("#servertime").removeAttr("id");