Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- var courses = []
- $.ajax({
- url: "/course/list/json",
- context: document.body,
- datatype: 'json',
- success: function(json){
- $.each(json.courses, function(key, val) {
- courses.push(val)
- });
- }
- });
- $('#course-add :text').change(function() {
- for(i=0; i<courses.length; i++) {
- console.log("loopar")
- if(courses[i]==$(this).val()) {
- console.log("matchar")
- $(this).addClass('red')
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment