Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
120
rated 0 times [  121] [ 1]  / answers: 1 / hits: 15259  / 14 Years ago, sun, april 18, 2010, 12:00:00

When I typed this apparently innocent snippet of code:



values.name


gedit highlighted name as a keyword. However, name is not listed by the pages linked to by an answer to a question about reserved keywords. I also did a couple trivial tests in SpiderMonkey, but name seemed to act like an ordinary identifier.



A Google search didn't tell me much either. However, I did find a page listing name in Other JavaScript Keywords. My guess is that name is a function or a member of some DOM element and does not intrude on the namespace.



Is name really a keyword in JavaScript? If so, what does it do?


More From » keyword

 Answers
20

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.


[#97040] Thursday, April 15, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ravenl

Total Points: 338
Total Questions: 107
Total Answers: 112

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
ravenl questions
Thu, Feb 18, 21, 00:00, 3 Years ago
Tue, Jan 12, 21, 00:00, 3 Years ago
Tue, Mar 17, 20, 00:00, 4 Years ago
;