HTML DOM Textarea form Property

HTMLDOMWeb DevelopmentFront End Technology

The HTML DOM Textarea form property returns the cite of the form which enclose the text area.


Following is the syntax −


Let us see an example of HTML DOM Textarea form Property:


Live Demo

<!DOCTYPE html>
   body {
      text-align: center;
      background-color: #363946;
      color: #fff;
   form {
      margin: 2.5rem auto;
   button {
      background-color: #db133a;
      border: none;
      cursor: pointer;
      padding: 8px 16px;
      color: #fff;
      border-radius: 5px;
      font-size: 1.05rem;
   .show {
      font-weight: bold;
      font-size: 1.4rem;
<h1>DOM Textarea form Property Demo</h1>
<form id="Form 1">
<legend>Form 1</legend>
<textarea rows="5" cols="20">Hi! I'm a text area element with some dummy text.</textarea>
<button onclick="identify()">Identify Textarea Form</button>
<p class="show"></p>
   function identify() {
      var formId = document.querySelector("textarea");
      document.querySelector(".show").innerHTML = "Hi! I'm from " + formId;


Click on “Identify Textarea Form” button to identify the form which contain the textarea element.

Updated on 16-Feb-2021 05:30:53