Wednesday, July 3, 2024
HomeLanguagesJavascriptHTML | DOM Input Image form Property

HTML | DOM Input Image form Property

The HTML DOM Input Image form Property is used for returning the reference to the form containing the input image field. It is a read-only property that returns a form object on success. 

Syntax: 

imageObject.form.id

Return Values: It returns a string value which specify the reference of the form containing the Input Image field

Below Example illustrate that how to return the Form Property. 
Example: 

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
        HTML DOM Input Image form Property
    </title>
</head>
<body style="text-align:center;">
    <h1 style="color:green;">
      neveropen
    </h1>
    <h4>
      DOM Input Image form Property
    </h4>
    <button onclick="my_geek()">
        <form id="myGeeks">
            <input id="myImage" type="image" formAction="test.php"
                   src=
                   alt="Submit" width="48" height="48" formMethod="post"
                   formNoValidate>
        </form>
    </button>
    <h2 id="Geek_h" style="color:green;"></h2>
    <script>
        function my_geek() {
 
            // Return Input Image form Property
            var txt = document.getElementById(
                "myImage").form.id;
            document.getElementById(
                "Geek_h").innerHTML = txt;
        }
    </script>
</body>
</html>


Output: 

  • Before Clicking On Button: 

  • After Clicking On Button: 

Supported Browsers: The browsers supported by HTML DOM Input Image form Property are listed below: 

  • Google Chrome 
  • Edge 12+
  • Firefox 
  • Opera 
  • Safari 

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

Nokonwaba Nkukhwana
Experience as a skilled Java developer and proven expertise in using tools and technical developments to drive improvements throughout a entire software development life cycle. I have extensive industry and full life cycle experience in a java based environment, along with exceptional analytical, design and problem solving capabilities combined with excellent communication skills and ability to work alongside teams to define and refine new functionality. Currently working in springboot projects(microservices). Considering the fact that change is good, I am always keen to new challenges and growth to sharpen my skills.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments