Parameter value Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Parameter

Description

The value property sets or gets the value attribute of a parameter.

Set the value property with the following Values

Value Description
value Sets the value of the parameter

Return Value

A String, representing the value of the parameter

The following code shows how to get the value of a <param> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<object data="horse.wav">
  <param id="myParam" name="autoplay" value="true">
</object>//from   w  w w.  j  av  a  2s .c om

<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>

Related Tutorials