The HTML wrap attribute defines how the text in a text area is to be wrapped when submitted in a form.
The HTML wrap attribute can be used on the <textarea> element.
Syntax:
<textarea wrap="soft|hard">
hard – the text in the textarea will be wrapped when submitting the form.
soft (default) – the text present in the textarea would not be wrapped after submitting the form.
Example:
<!DOCTYPE html>
<html>
<body>
<form action="">
<textarea rows="3" cols="25" name="text" wrap="hard">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elementum justo at purus congue ultrices. In lectus orci, bibendum a cursus sed, ultricies ac neque.
</textarea>
<input type="submit">
</form>
</body>
</html>
Almost all attributes are defined to be used with particular elements. However, some of them are available for use on all HTML elements. These attributes are called– Global Attributes.
The HTML spellcheck attribute defines whether the element is to have its spelling and grammar checked or not.
The spellcheck attribute can be used with input and teaxtarea HTML elements, and the user input value can be checked for grammatical and spelling mistakes.
Syntax:
<element spellcheck="true|false">
true – the element is to have its spelling and grammar checked.
false – the element is not to be checked.
Example:
<!DOCTYPE html>
<html>
<body>
<p contenteditable="true" spellcheck="true">This text is editable and has some mistakkees. Try to change the text.</p>
First name: <input type="text" name="first-name" spellcheck="true">
</body>
</html>
Output:
This text is editable and has some mistakkees. Try to change the text.