Use the wrap attribute to set the text wrap in HTML. You can try to run the following code to implement wrap attribute −
Example
<!DOCTYPE html> <html> <body> <form action = ""> <textarea rows = "2" cols = "12" name = "details" wrap = "hard"> This is demo text This is demo text This is demo text This is demo text</textarea><br> <input type = "submit"> </form> </body> </html>