Click to See Complete Forum and Search --> : <buttons> os <input type = button > ?


DaveinLondon
01-17-2005, 11:44 PM
What is the diference in using the <button> vs the <input> tags ?

eg:

<button type="submit" value = "rooms" onMouseover="this.style.backgroundColor='red'"
onMouseout="this.style.backgroundColor='lime'" name = "btn"
class="btn" >Rooms </button>


OR

<input type="submit" value = "rooms" onMouseover="this.style.backgroundColor='red'"
onMouseout="this.style.backgroundColor='lime'" name = "btn"
class="btn" >

why have two tags ?
which is best to use ?
are they both supported in DOM ?

thanks for any clarification !

Pittimann
01-18-2005, 12:05 AM
Originally posted by DaveinLondon
why have two tags ?
which is best to use ?
are they both supported in DOM ?1. Why not? Or are you talking about the fact that <button> needs a closing tag?
2. I personally prefer <input type=...> because <button> is not supported by some older browsers which already support the <input> thingy.
3. Yes:

http://www.w3.org/TR/REC-html40/interact/forms.html#edef-BUTTON
http://www.w3.org/TR/REC-html40/interact/forms.html#edef-INPUT

Cheers - Pit

Charles
01-18-2005, 04:37 AM
I prefer the BUTTON element because it makes applying different styles to my BUTTON and INPUT elements a little bit easier.