HTML | DOM Option form Property

The Option form Property in HTML DOM is used for returning the reference of the form that belongs to Option Element. This Property is read-only that returns a form object on success.



Return Values: It returns a reference to the form that contains an Option Element. It returns a null value if the option is not in the Form.

Example: This Example returns an Option Form Property.





<!DOCTYPE html>
      DOM option form Property
        body {
            text-align: center;
        h1 {
            color: green;
    <h2>DOM option Form Property</h2>
    <form id="myGeeks">
        <select id="GFG">
            <option id="sudo">
              Choose an option
            <option value="html">
            <option value="java">
            <option value="C++">
            <option value="php">
            <option value="perl">
    <button onclick="myGeeks()">
    <h3 id="demo"></h3>
        function myGeeks() {
            var x = document.getElementById(
              "demo").innerHTML = x;


Before Clicking On Button:

After Clicking On Button:

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

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

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.