i look at W3C but not find any rule for browser, all the browser apply the css to all the id, but if you try to use JS than the problem arise.
can any one say me, what is the rule to the browser to do if i used this
<head>
<style type="text/css">
#Button{color:red;}
</style>
</head>
<body>
<form>
<input id="Button" type="button" value="Click me"/>
<input id="Button" type="text" value="Type Here"/>
</form>
</body>
apply the style to only the first element defined with that selector
apply the style to only the last element defined with that selector
i know applying on both is not ture.
The standards say that your ids should be unique.
However, browsers are built to cater for badly written sites, and will happily apply the style to both elements (I think this works for all current browsers).
It does not make it right though! You should avoid this like the plague.
If you want to apply the same style to multiple elements, then use a
classinstead.