The ready-made tool here is the jQuery Validation Plugin, which turns the entire input box into a red dotted line. Normally it is a solid black line. This may also be more concerned about the rights of color-blind people
Textarea is a pure text editing control, and tags cannot be nested in it. According to your needs, the following ideas are provided. You can input in textarea, add a p at the end, the level is under textarea, and p gets the text synchronously The content of the box is verified using regular js. If there are sensitive words in the string, add color to the substring.
The ready-made tool here is the jQuery Validation Plugin, which turns the entire input box into a red dotted line. Normally it is a solid black line. This may also be more concerned about the rights of color-blind people
textarea is a pure text editing control. It cannot render the text inside into multiple different colors, and it cannot contain other tags
Let’s use another tag to synchronize the output content and the correct or incorrect conditions inside. This is richtext
Remove the font tag. If it is illegal, set the color in texarea: #red
This is equivalent to a simplified text editor. The textarea obtains the input content synchronously.
Textarea is a pure text editing control, and tags cannot be nested in it. According to your needs, the following ideas are provided. You can input in textarea, add a p at the end, the level is under textarea, and p gets the text synchronously The content of the box is verified using regular js. If there are sensitive words in the string, add color to the substring.
Use regex to verify. You can’t write font tag directly in the textarea tag
Regular judgment, and then replace() the erroneous characters.