Get Fieldset Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Fieldset

Introduction

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>
<html>
<body>

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

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

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

Related Tutorials