The name
property sets or gets the value of the name attribute of a parameter.
The name
attribute specifies the name of a <param> element and
works together with the value attribute to specify parameters for the plugin
specified with the <object> tag.
name |
Yes | Yes | Yes | Yes | Yes |
Return the name property.
var v = parameterObject.name
Set the name property.
parameterObject.name=name
Value | Description |
---|---|
name | Set the name of the parameter |
A String type value representing the name of the parameter.
The following code shows how to get the name of a <param> element.
<!DOCTYPE html>
<html>
<body>
<!--from w ww.ja va 2s . c o m-->
<object data="notExist.wav">
<param id="myParam" name="autoplay" value="true">
</object>
<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>
The code above is rendered as follows: