使用wrap属性设置HTML中的文本换行。您可以尝试运行以下代码来实现wrap属性-
<!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>