Highlight the searched word in a result.
Acceptance criteria
- 1.Highlight the searched word in a result.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <mark> Tag chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “The tag in HTML is used to highlight text , typically to indicate relevance or search results. Browsers usually render it with a yellow background by default. It is an inline element and does not change the text's semantic importance beyond visual highlighting.” .
1.Highlight a matchexercise · easy · 10 min
Highlight the searched word in a result.
Passes when: Highlight the searched word in a result.
2.Highlight a dateexercise · easy · 10 min · practice plan
Highlight the important date.
Passes when: Highlight the important date.
3.Two highlightsexercise · easy · 10 min · practice plan
Highlight two matches in one sentence.
Passes when: Highlight two matches in one sentence.
4.Highlight in a listexercise · easy · 10 min · practice plan
Highlight the matching word inside a list item.
Passes when: Highlight the matching word inside a list item.
5.Highlight inside a quotationexercise · medium · 10 min · practice plan
Highlight the relevant phrase inside a quote.
Passes when: Highlight the relevant phrase inside a quote.
6.Fix the background colour used to highlightbug fix · easy · 8 min
Use the element, not an inline style.
Passes when: Use the element, not an inline style.
7.Fix bold used as a highlightbug fix · easy · 8 min · practice plan
Relevance is mark, not bold.
Passes when: Relevance is mark, not bold.
8.Fix the missing second highlightbug fix · easy · 8 min · practice plan
Both matches should be highlighted.
Passes when: Both matches should be highlighted.
9.Fix the highlight outside the itembug fix · easy · 8 min · practice plan
The match belongs inside the list item.
Passes when: The match belongs inside the list item.
10.Fix the highlight on the wrong wordbug fix · easy · 8 min · practice plan
The searched term is what should be highlighted.
Passes when: The searched term is what should be highlighted.
Between them these tasks cover Highlighting, Search results and Relevance.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.