About 176,000 results
Open links in new tab
  1. How to disable HTML button using JavaScript? - Stack Overflow

    Jun 10, 2010 · var input = document.querySelector('#test'); // the attribute works as expected console.log('old attribute:', input.getAttribute('value')); // the property is equal to the attribute when the property is not explicitly set console.log('old property:', input.value); // change the input's value property input.value = "My New Value"; // the attribute remains there because it still exists in the ...

  2. Enable/disable a button in pure javascript - Stack Overflow

    How to Disable and Enable a button with Javascript. 0. disable and enabling a html button. 1.

  3. javascript - Disabling and enabling a HTML input button - Stack …

    Dec 12, 2012 · While not directly related to the question, if you hop onto this question looking to disable something other than the typical input elements button, input, textarea, the syntax won't work. To disable a div or a span, use setAttribute

  4. javascript - Disabling the button after once click - Stack Overflow

    May 18, 2014 · This code will let you submit the form once, then disable the button. Change the selector in the find() function to whatever button you'd like to disable. Note: Per Francisco Goldenstein, I've changed the selector to the form and the event type to submit. This allows you to submit the form from anywhere (places other than the button) while ...

  5. How do I disable and re-enable a button in with javascript?

    Aug 30, 2013 · I can easily disable a javascript button, and it works properly. My issue is that when I try to re-enable that button, it does not re-enable. Here's what I'm doing: <script type="text/javascr...

  6. Disabling a button in vanilla JavaScript and in jQuery

    Vanilla JavaScript In vanilla JavaScript, one can easily enable and disable a button using the following statement: button.disabled = state; This works both when humans try to click a button and w...

  7. javascript - Enable and disable button by if - Stack Overflow

    Nov 6, 2018 · Here is an example, using the input event for disabling and enabling the button. Note, that the button is not initially disabled. To fix that, I created the checkIfSet function, so I can just set it on the addEventListener and also just call …

  8. Disable button whenever a text field is empty dynamically

    Aug 15, 2011 · How to enable/disable a button dynamically with JavaScript, based on conditions with textfields.

  9. Disable/Non-Clickable an HTML button in Javascript

    On a certain event, I need to disable this button completely. I tried with the following code, but it does not disable/gray out the button and it's still clickable. var resetBtn = document.getElementById("reset"); resetBtn.disabled = true; As someone suggested that the CSS I have applied is causing this issue.

  10. javascript - Simplest way to disable button on submission of a …

    If your submit-button is not a direct child of the form-element you will need to replace children with find. Additionally, your submit-button may also be a button element instead of an input element. E.g. This is the case if you are using Bootstrap horizontal forms. Below is a …

Refresh