Javascript examples for DOM HTML Element:Fieldset
Fieldset name Property - Change the value of the name attribute of a fieldset:
<!DOCTYPE html> <html> <body> <form> <fieldset id="myFieldset" name="personalia"> Name: <input type="text" name="username"><br> Email: <input type="text" name="usermail"><br> </fieldset> </form>/* w w w . j a va 2 s. c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myFieldset").name = "newName"; document.getElementById("demo").innerHTML = document.getElementById("myFieldset").name; } </script> </body> </html>