javascript - Using JS how to dynamically change the text background color in a displayed html file -
i have log file (.log
) , wanted open log file html page. , specific strings, have change text color, e.g. if text apple
there in log file, wanted show text apple
in green
color.
any help?
having program converts log file html wrap "apple" strings in final html this
<span class="myappleclass">apple</span>
and either using css file or style tag inside head tag css class green this
<head> <style> .myappleclass { color: green; } </style> </head>
would work.