0
How to work a search bar without regex or any library in JavaScript .?
When I am trying to make search bar there is a problem . You can see in that code . I don't know what to write in the if statement . In this case when I type any key ,then the body shows " sorry , not found " . The need is when I am press "s / sa/ sam ... Samsung" then the body should show the 'samsung m31 phone' . How can I do that .? What I am writing in the if statement .. I have lack of logics , i want to improve that .. So , also could anyone tell me the idea .. https://code.sololearn.com/WXEay3VfxvGp/?ref=app
3 ответов
+ 1
You don't need to do anything for a match; You only need to hide the mismatch.
The if condition should be mismatch, and add display: "none" to the mismatch element
0
Please anyone tell me.
0
.