
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>
Output:
Enjoy coding!
Read also: