Me hdi
Me hdi

Reputation: 1912

several class different in one input?, how is it?

how is puting tow class different in one input?
classes is: auto and date.
did is this true?

    <input type="text" name="date_go" class="auto" class="date">

Upvotes: 0

Views: 77

Answers (1)

alex
alex

Reputation: 490243

Don't do that. A HTML element should contain unique attributes only.

In my experience, browsers tend to just use the first or last one defined in the markup (what does your browser do?)...

Chrome example

Google Chrome has decided to use the first attribute defined in the markup when building the DOM.

Instead, do this...

<input type="text" name="date_go" class="auto date">

...or in other words, if you want multiple classes, join them together with a space in the class attribute.

jsFiddle.

Upvotes: 9

Related Questions