HTML DOM Textarea रैप प्रॉपर्टी एक HTML दस्तावेज़ में टेक्स्ट एरिया एलिमेंट के रैप एट्रिब्यूट के मान को लौटाती है और संशोधित करती है।
सिंटैक्स
निम्नलिखित वाक्य रचना है -
<मजबूत>1. रिटर्निंग रैप
object.wrap
<मजबूत>2. रैप जोड़ना
object.wrap = soft | hard
आइए HTML DOM Textarea रैप प्रॉपर्टी का एक उदाहरण देखें:
उदाहरण
<!DOCTYPE html>
<html>
<style>
body {
color: #000;
height: 100vh;
}
.btn {
background: #db133a;
border: none;
height: 2rem;
border-radius: 2px;
width: 40%;
display: block;
color: #fff;
outline: none;
cursor: pointer;
margin: 1rem 0;
}
.show {
font-size: 1.5rem;
margin: 1rem 0;
}
</style>
<body>
<h1>DOM Textarea wrap Property Demo</h1>
<form action='' method="post">
<textarea rows="5" cols="28" wrap="soft">
Hi! I'm a text area element with some dummy text.
</textarea>
<input type="submit" class='btn' value="Submit Form">
</form>
<button onclick="set()" class="btn">Show wrap value</button>
<div class="show"></div>
<script>
function set() {
document.querySelector('.show').innerHTML = "The value of wrap attribute is " + document.querySelector("textarea").wrap;
}
</script>
</body>
</html> आउटपुट

“रैप वैल्यू दिखाएं . पर क्लिक करें textarea तत्व की रैप विशेषता का मान प्रदर्शित करने के लिए बटन।
