The value
property sets or gets the value attribute of a parameter.
The value
attribute specifies the value of a <param> element
and works together with the name attribute to specify parameters for
the plugin specified with the <object> tag.
value |
Yes | Yes | Yes | Yes | Yes |
Return the value property.
var v = parameterObject.value
Set the value property.
parameterObject.value=value
Value | Description |
---|---|
value | Specifies the value of the parameter |
A String type value representing the value of the parameter.
The following code shows how to get the value of a <param> element.
<!DOCTYPE html>
<html>
<body>
<!-- ww w . j a v a 2 s . com-->
<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").value;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: