Home > Web Front-end > JS Tutorial > body text

How to make different texts in textarea display different colors_javascript skills

WBOY
Release: 2016-05-16 17:03:07
Original
2139 people have browsed it

How to make different texts in textarea display different colors? If you control the style of textarea, all text will be the same color;

will not work if you put the text in a markup, because the markup will not be interpreted and is treated as text.

I found a method on the Internet:

I copied the code into txt and modified it into html format. The test works. The html is as follows:

Copy code The code is as follows:


< head>
ff




< textarea id="test" name="topic" rows="10" cols="40">





Copy the above code into a txt, and then change the txt file It is an html file, for example, change it to a.html, open it with a browser, and click the "Submit" button, the running results are as follows:

How to make different texts in textarea display different colors_javascript skills
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template