Search Keyword Highlighting < JavaScript | The Art of Web
samedi 12 septembre 2015 à 19:37KraZhtest - Liens utiles - C'est le bordel
Recherche instantanée, en gros équivalent à un bon vieux CTRL + F, mais bon 5% des gens s'en servent. Ca fait le coup à chaque fois hihihi.
Démo: http://www.the-art-of-web.com/search-highlight-demo.html
{code
<div id="container">
<form>
Search: <input id="keywords" placeholder="start typing"></p>
</form>
<script src="http://www.the-art-of-web.com/hilitor.js"></script>
<!-- Host your scripts! -->
<script>
var myHilitor;
document.addEventListener("DOMContentLoaded", function() {
myHilitor = new Hilitor2("container");
myHilitor.setMatchType("left");
}, false);
document.getElementById("keywords").addEventListener("keyup", function() {
myHilitor.apply(this.value);
}, false);
</script>
code}
Recherche instantanée, en gros équivalent à un bon vieux CTRL + F, mais bon 5% des gens s'en servent. Ca fait le coup à chaque fois hihihi.
Démo: http://www.the-art-of-web.com/search-highlight-demo.html
{code
<div id="container">
<form>
Search: <input id="keywords" placeholder="start typing"></p>
</form>
<script src="http://www.the-art-of-web.com/hilitor.js"></script>
<!-- Host your scripts! -->
<script>
var myHilitor;
document.addEventListener("DOMContentLoaded", function() {
myHilitor = new Hilitor2("container");
myHilitor.setMatchType("left");
}, false);
document.getElementById("keywords").addEventListener("keyup", function() {
myHilitor.apply(this.value);
}, false);
</script>
code}