
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Textarea form Property
The HTML DOM Textarea form property returns the cite of the form which enclose the text area.
Syntax
Following is the syntax −
object.form
Let us see an example of HTML DOM Textarea form Property:
Example
<!DOCTYPE html> <html> <style> 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; } </style> <body> <h1>DOM Textarea form Property Demo</h1> <form id="Form 1"> <fieldset> <legend>Form 1</legend> <textarea rows="5" cols="20">Hi! I'm a text area element with some dummy text.</textarea> </fieldset> </form> <button onclick="identify()">Identify Textarea Form</button> <p class="show"></p> <script> function identify() { var formId = document.querySelector("textarea").form.id; document.querySelector(".show").innerHTML = "Hi! I'm from " + formId; } </script> </body> </html>
Output
Click on “Identify Textarea Form” button to identify the form which contain the textarea element.
- Related Questions & Answers
- HTML DOM Textarea cols Property
- HTML DOM Textarea rows Property
- HTML DOM Textarea placeholder Property
- HTML DOM Textarea disabled Property
- HTML DOM Textarea defaultValue Property
- HTML DOM Textarea name Property
- HTML DOM Textarea readOnly Property
- HTML DOM Textarea wrap Property
- HTML DOM Textarea autofocus Property
- HTML DOM Textarea required Property
- HTML DOM Textarea maxLength Property
- HTML DOM Select form Property
- HTML DOM Legend form Property
- HTML DOM Form name Property
- HTML DOM Form acceptCharset Property
Advertisements