Get Parameter Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Parameter

Introduction

The Parameter object represents an HTML <param> element.

You can access a <param> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<object data="your.wav">
  <param id="myParam" name="autoplay" value="true">
</object>/*from w w w . j a  v  a  2 s  .co m*/

<button onclick="myFunction()">get the name of the parameter</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myParam").name;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials