Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it valid to put a period in the "name" attribute of a HTML5 input? [duplicate]

Tags:

html

Possible Duplicate:
What are valid values for the id attribute in HTML?
valid value for name attribute in html

It is valid to name a HTML5 input with a string containing a period?

<input type="text" name="article.title" value="The title"/> 
like image 817
David Tuite Avatar asked Sep 29 '12 08:09

David Tuite


People also ask

Can HTML ID have period?

The ID and NAME elements must start with a letter i.e. upper case A to Z or lower case a to z; a number is not allowed. After the first letter any number of letters (a to z, A to Z), digits (0 to 9), hyphens (-), underscores (_), colons (:) and periods (.) are allowed.

What does an HTML5 type attribute for an input element do?

The type attribute specifies the type of <input> element to display. If the type attribute is not specified, the default type is "text".

Which of the following statements are correct syntax in HTML5 input type?

Explanation: The correct syntax of HTML5 doctype is <! doctype html>, doctype is the very first thing to write in HTML5.


1 Answers

Yes, it's valid.

But you will make things difficult for yourself if you need to access them via JS or CSS in particular. Again, it can be done, but it will make things difficult.

My advice is to use a hyphen instead.

like image 164
Spudley Avatar answered Sep 19 '22 18:09

Spudley