Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Safari <button disabled></button> doesn't disable?

Tags:

html

ios

safari

I was checking out a form I made on my iPad and it appears that adding disabled to a <button> tag doesn't actually disable the button.

Adding disabled to an <input> tag works but not <button>.

So

<input type = "text" disabled />

works, but

<button disabled>Hola</button>

doesn't. Thoughts on ways to fix this? Or is it just a safari bug?

like image 472
Nick Chapman Avatar asked Oct 29 '13 00:10

Nick Chapman


1 Answers

You can use the disabled attribute on an <input /> tag but not a <button /> Tag. Button isn't officially depreciated but because you can do

<input type="submit" value="Click Me">

for form submission capabilities and

<input type="button" value="Click Me">

for a generic plain-old button there is no real point to having a whole different tag. Furthermore you can disable both a submit and a regular button by adding disabled

<input type="submit" value="You can't Click Me" disabled>
<input type="button" value="Click Me" disabled>
like image 97
edhurtig Avatar answered Sep 30 '22 15:09

edhurtig