html5 - How to enable a disabled button by clicking on another button? -


i have 2 buttons:

<button onclick=initialize() id="1" data-role="button" data-mini="true" data-corners="false" data-theme="b">show position</button> <button onclick=calcroute() id="2" data-role="button" data-mini="true" data-corners="false" data-theme="b">evacuate !</button> 

i want have second button disabled default, , have enabled if clicking on first button. how accomplish this?

please see following answers questions:

the simplest approach (just pure example w/out taking consideration browsers, etc):

<html> <head>     <script>         function enablebutton2() {             document.getelementbyid("button2").disabled = false;         }     </script> </head> <body>     <input type="button" id="button1" value="button 1" onclick="enablebutton2()"  />     <input type="button" id="button2" value="button 2" disabled /> </body> </html> 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -