Skip to content

Conversation

@eric-analyze
Copy link

Annelies told me the html was getting complicated (lots of code to highlight a word, at least that was a few weeks ago). This example demonstrates a method which only needs adding some text around the highlighted text pairs, replacing # with the same number per pair (number of text, but start with hl...)(it is HL for highlight, not h1). Javascript adds and removes the .highlight css class on mouse events. css and javascript code can be in seperate files of course. Use it if you think it is useful, kind regards, Eric :)

Annelies told me the html was getting complicated (lots of code to highlight a word). This example demonstrates a method which only needs adding <span class="hl#">some text</span> around the highlighted text pairs, replacing # with the same number per pair (number of text, but start with hl...)(it is HL for highlight, not h1). Javascript adds and removes the .highlight css class on mouse events. css and javascript code can be in seperate files of course.
@eric-analyze eric-analyze changed the base branch from main to dev August 10, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants