Backend for songs.zachdecook.com
Diffstat (limited to 'toc-filter.js')
-rw-r--r--toc-filter.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/toc-filter.js b/toc-filter.js
new file mode 100644
index 0000000..08afa2d
--- /dev/null
+++ b/toc-filter.js
@@ -0,0 +1,18 @@
+$(function(){
+ $("#toc-filter").bind("change paste keyup", toc_filter);
+});
+
+function toc_filter( event )
+{
+ var val = $(this).val().toLowerCase();
+ $("#toc li").each(function(){
+ if($(this).text().toLowerCase().indexOf(val) == -1)
+ {
+ $(this).hide();
+ }
+ else
+ {
+ $(this).show();
+ }
+ });
+} \ No newline at end of file