<input type="search" name="search-mini" id="search-mini" value="" data-mini="true" />
<ul>
<li><h3 class="text"> Hello</h3></li>
<li><h3 class="text"> Thank you</h3></li>
</ul>
If the code is written like this, if you type "Hi" in the input box, I want to show you only the "Hello" part that contains the text "Hi".
Current JavaScript is
// input character import part
var i = $('#search-mini').val();
// h3 Importing characters
var j = $('.text').text();
That's all I've written.
javascript html web
As someone recommended AngularJS in the comments, it's basically a part where you have to bind event. And you need conditions where the input actually matches the text reasonably.
Please note that I wrote demo under the premise of writing jQuery.
© 2024 OneMinuteCode. All rights reserved.