Javascript examples for DOM HTML Element:Fieldset
The type property returns the type of form fieldset element.
For a fieldset, this property will always return "fieldset".
This property is read only.
A string, representing the type of form element the fieldset is
The following code shows how to return which type of form element the fieldset is:
<!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>/*from w w w .j a va2s .co m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myFieldset").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>