What is the `name` keyword in JavaScript?

Its not a javascript reserved word, its an html attribute. Any DOM element can have a name. Looks like your syntax editor will still highlight it.


(I know this was asked 2 years ago but, ...) This happened to me also, for example this below would not work.

name = document.getElementById('nombre');
//something else
name.className = 'thinking';

Instead I changed it to

username = document.getElementById('nombre');
//something else
username.className = 'thinking';

and it did work! Yeah, alright that's all, but it's something I find maybe quite interesting, also because of the 'name' attribute of the 'a' tag. Something to watch out for.