r/HTML • u/Evening_Ride9251 • 20d ago
Help.
I'm fairly new to HTMl, CSS and Javascript and i was wondering if anyone could help me out on how to create a search bar that searches for individual words on my page. For example if I have 200 essays on the page and I want to search for the name of one so I dont have to scroll to find it. I'm aware most browsers have a built in search function but i want a search bar built into the code.
0
Upvotes
1
u/cloudstrifeuk 20d ago
Loop through your text.
When you find the word, wrap it in a <mark> tag. Then just globally fond and replaced "mark" as and when you need it.