Search code examples
javascriptcontrolsprototypejs

Getting all controls in a form using JavaScript or Prototype and enable them?


How can I get all controls (radio buttons, selects, text fields and so on) and set their state to enabled?


Solution

  • With Prototype.js:

    $$(":input").each(function (el) {
       el.enable();
    });​
    

    DEMO.