Skip to content
Related Articles

Related Articles

Improve Article

HTML | DOM Parameter name Property

  • Last Updated : 10 Jun, 2021

The HTML DOM Parameter name Property is used for setting or returning the name attribute of a parameter. The name Attribute is used to reference the form-data after submitting the form or to reference the element in a JavaScript.
Syntax: 
 

  • It return the name property. 
     
parameterObject.name 
  • It is used to set the name property. 
     
parameterObject.name = name 

Property Values: Accepts a single parameter name and it specifies the name of the parameter element
Return Value: It returns a string value which represent the name of the parameter element.
Example: This program illustrate how to return the name Property. 
 

html




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

Output: 
Before click on the button 
 

After click on the button 
 



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

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

 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :