Skip to content
Related Articles

Related Articles

HTML | DOM Label form Property

View Discussion
Improve Article
Save Article
  • Last Updated : 30 Jan, 2020

The HTML DOM Label form Property is used for returning the reference to the form containing the Label Element. It is read-only Property that returns a form object on success.



Return Value: It returns a reference that contains the label and null if the label is not in the form returns a form.


<!DOCTYPE html> 
    <title>DOM Label Form Property</title>
        body {
            font-size: 20px;
<body style="text-align:center">
    <h1 style="color:green">GeeksforGeeks</h1>
    <h2> HTML DOM Label Form Property</h2>
    <form id="geeks">
        <!-- Starts label tag from here -->
        <label id="sudo" for="student">
        <input type="radio" 
        <label for="business">
        <input type="radio" 
        <label for="other">
        <!-- Ends label tags here -->
        <input type="radio"
    <button onclick="myGeeks()">Submit</button>
    <p id="gfg"></p>
        function myGeeks() {
            var g = document.getElementById("sudo");
            document.getElementById("gfg").innerHTML = g;

Before Clicking On Button:

After Clicking On Button:

Supported Browsers: The browsers supported by DOM Label form Property are listed below:

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!