Open In App

HTML DOM Parameter value Property

Last Updated : 19 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML DOM Parameter value Property is used to set or return the value of the value attribute of a parameter, however, the contents of the value attribute do not show to the user. When the form is submitted by the user, the value and the other information are sent to the server. But when the checkbox is unchecked state, therefore, no information will be sent.
Syntax: 

  • It returns the value property: 
parameterObject.value 
  • It is used to set the value property. 
parameterObject.value = value 

Property Values It contains single value text which is used to specify the value associated with the parameter.

Return Value: It returns a string value that represents the value of the value attribute of a parameter.

Example: This example returns the parameter value property. 

html




<!DOCTYPE html>
<html>
   
<head>
    <title>
        HTML DOM Parameter value Property
    </title>
</head>
   
<body>
    <center>
        <h2>
            GeeksForGeeks
        </h2>
        <h2>
            HTML DOM Parameter value Property
        </h2>
        <h4>Click the button</h4>
        <button onclick="GFG()">Click Here!<br>
        </button>
        <object data="sample.mp4">
            <param id="myParam" name="Autoplay" value="true">
        </object>
        <p id="Geeks"></p>
 
        <script>
            function GFG() {
                let x = document.getElementById("myParam").value;
                document.getElementById("Geeks").innerHTML = x;
            }
        </script>
    </center>
</body>
   
</html>


Output: 

 

Supported Browsers: The browsers supported by DOM Parameter value Property are listed below: 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads