Javascript examples for DOM HTML Element:Parameter
The name property sets or gets the name attribute of a parameter.
Set the name property with the following Values
Value | Description |
---|---|
name | Sets the name of the parameter |
A String, representing the name of the parameter
The following code shows how to get the name of a <param> element:
<!DOCTYPE html> <html> <body> <object data="horse.wav"> <param id="myParam" name="autoplay" value="true"> </object>/* w w w .j a va 2 s .c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myParam").name; document.getElementById("demo").innerHTML = x; } </script> </body> </html>