Javascript examples for DOM HTML Element:Fieldset
Fieldset disabled Property - Disable and enable a fieldset:
<!DOCTYPE html> <html> <body> <form> <fieldset id="myFieldset"> <legend>Personalia:</legend> Name: <input type="text"><br> Email: <input type="text"><br> Date of birth: <input type="text"> </fieldset> </form><br> <button onclick="disableField()">Disable fieldset</button> <button onclick="enableField()">Enable fieldset</button> <script> function disableField() {//from w ww . j a v a 2 s .c om document.getElementById("myFieldset").disabled = true; } function enableField() { document.getElementById("myFieldset").disabled = false; } </script> </body> </html>