Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Button v Input

Featured Replies

I don't exactly need help here. I'm just looking to start a discussion on the use of these two elements.

 

First off, these two work essentially the same (correct me if i'm wrong).

 

I can submit a form with

 

<input type="submit" />

or

<button type="submit"></button>

 

And they can be styled to essentially look the same. (With the use of :hover & :active)

 

I'm currently in the process of redesigning one of our old sites and i've noticed in th previous developers code he has used <input> in one place & <button> in others.

 

Normally i've always stuck to <input> and have never bothered to use <button>, because I just like the look of my code when creating forms all showing <input>. :v

 

So I just wanted to know if there was any REAL difference - apart from the default browser styles - from a semantic POV and if there are if somebody could point out when i'm really supposed to use <button> and when i'm supposed to use <input>.

 

Also pros/cons if any.

 

Thanks!

Semantically they're identical and both an equal pain in the neck to style.

 

The one advantage that <button> has over <input> is that you can put other inline elements inside <button>. This makes it remarkably handy for stylised buttons using the sliding-doors technique.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.