treehouse : what would you like to learn today?
Web Design Web Development iOS Development

What is the diff between tag &

  • Hi,

    Can you explain me What is the difference between <button> tag & <input type"button">.
    Those two things are performing the same. Then Why we need two things in HTML?
  • button element explained here
  • you can apply background images to buttons... and you cant inputs haha.
    thats all the difference i need to know.
  • I always prefer the <input>, since the <button> shows trouble sending information when it comes to IE in general. Although there's a javascript that'll fix it, I wouldn't trust it to have the job done. And it's easy to have a gradient background on an <input>, but if you want to style it like a <button> - you've got a challenge (especially cross browsers).

    I do believe it was Eric Meyer who said something like: Because browsers usually take somewhat controll over <input> elements, I don't give them much style.