Get Fieldset Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Fieldset


The Fieldset object represents an HTML <fieldset> element.

You can access a <fieldset> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<fieldset id="myFieldset" name="personalia">
  Name: <input type="text" name="username"><br>
  Email: <input type="text" name="usermail"><br>

<button onclick="myFunction()">disable the fieldset</button>

function myFunction() {/*from   ww w .  ja v  a 2 s  .co m*/
    var x = document.getElementById("myFieldset");
    x.disabled = true;

Related Tutorials