Created
February 13, 2018 15:57
-
-
Save jakeleboeuf/3ca45bb52ad72655ef248ee8c68c45c9 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/juleyinijo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.tokyoDrift { | |
color: red; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="jake">Not Done</div> | |
<div class="jake">Complete</div> | |
<div class="jake">Not Done</div> | |
<script id="jsbin-javascript"> | |
(function() { | |
$(document).ready(function() { | |
rtHighlight.init(); | |
}); | |
var rtHighlight = { | |
init: function() { | |
rtHighlight.setHighlight({low: 0, high: 5}, 'Not Done', 'tokyoDrift'); | |
}, | |
setHighlight: function(range, searchString, classNameToAdd) { | |
$('div').slice(range.low, range.high).filter(function(){ | |
return $(this).text() === searchString; | |
}).addClass(classNameToAdd); | |
} | |
} | |
})(); | |
</script> | |
<script id="jsbin-source-css" type="text/css">.tokyoDrift { | |
color: red; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
(function() { | |
$(document).ready(function() { | |
rtHighlight.init(); | |
}); | |
var rtHighlight = { | |
init: function() { | |
rtHighlight.setHighlight({low: 0, high: 5}, 'Not Done', 'tokyoDrift'); | |
}, | |
setHighlight: function(range, searchString, classNameToAdd) { | |
$('div').slice(range.low, range.high).filter(function(){ | |
return $(this).text() === searchString; | |
}).addClass(classNameToAdd); | |
} | |
} | |
})();</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tokyoDrift { | |
color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
$(document).ready(function() { | |
rtHighlight.init(); | |
}); | |
var rtHighlight = { | |
init: function() { | |
rtHighlight.setHighlight({low: 0, high: 5}, 'Not Done', 'tokyoDrift'); | |
}, | |
setHighlight: function(range, searchString, classNameToAdd) { | |
$('div').slice(range.low, range.high).filter(function(){ | |
return $(this).text() === searchString; | |
}).addClass(classNameToAdd); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment