<li><a><img src="img/location/airport.png"><<h3> Where is the airport?</h3><h3>Where is the airport?</h3></a></li>
$(document).ready(function () {
$("#search-mini").keyup(function () {
var k = $(this).val();
$(".content > ul > li > a").hide();
var temp = $(".content > ul > li > a > h3:contains('" + k + "')");
$(temp).parent().show();
});
});
When searching for the sentence "Where is the air?" in the HTML # h3 tag, I want to make it appear even if I type "where", so please tell me how to ignore case-sensitive charactersㅜ <
javascript jquery
I'll replace it with the answers that come out when I google it.
You can expand the expression of the selector in jQuery.
https://jsfiddle.net/bipen/dyfRa/
This example is based on jQuery 1.9.1 and
The default expr object has been expanded to make it available for other keywords (containsIN).
For case sensitive, all strings (textContent/innerText) were converted to lowercase and compared.
© 2024 OneMinuteCode. All rights reserved.