Skip to content

Instantly share code, notes, and snippets.

@surrealdetective
Last active December 19, 2015 03:39
Show Gist options
  • Save surrealdetective/5892068 to your computer and use it in GitHub Desktop.
Save surrealdetective/5892068 to your computer and use it in GitHub Desktop.
First practice with Jquery
/*
Table of Contents
1. ./public/js/app.js
2.index.html
*/
//app.js
$(document).ready(function(){
$('#submit_search').click(function(){
var search_term = $('#find_student').val();
$("li:contains('" + search_term + "')").css("color", "yellow");
});
});
//index.html, at the bottom of code, above </body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.8.0.min.js"><\/script>')</script>
<script src="js/app.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment