How do I disable the radio button using JavaScript?

 Disable property in JavaScript

The disabled property returns whether a radio button should be disable or not. A disable element is unsuable and un-clickable.

Syntax:radioObject.disabled

set the disable property:-radioObject.disable = false\true

  • True :- The radio button is disable.
  • False :- The radio button is not disable.

Let’s See an example of it:-

  1. <!DOCTYPE html> 
  2. <html> 
  3. <body> 
  4. Radio Button: <input type="Radio" id="myRadio"><br> 
  5. <p> click the "submit" button to disable the radio button.</p> 
  6. <button onclick="myFunction()">submit</button> 
  7. <script> 
  8. function myFunction(){ 
  9. document.getElementById("myRadio").disabled = true; 
  10. } 
  11. </script> 
  12. </body> 
  13. </html> 

Comments

Popular posts from this blog

proassignment help backlink data index 41

programming shark backink data index 31

Programming shark backlink data index 67