How to highlight a text a style it like wordpad

Hello…i have have been programming for about 4 months now and i am working on a simple with java script.i have been trying to search for an event that will highlight my text and get the values so that i can add style to it.But cant find any on google.please i would to very happy if i can get any assist from here…

A start would be to put an id attribute in the text you want to highlight.

Then you can access that element with the document.getElementById() and style it with help from this link

If you have an example of what you are trying to achieve then please share so we can help you out better.

1 Like

Thanks for your help
That was not what I was really looking for but your idea has give me a great idea

When do you want that event to trigger exactly?

when the user highlight text a text