Created
July 28, 2017 12:10
-
-
Save Ghost---Shadow/4787671b4d37f5d77ea73cad71a46b15 to your computer and use it in GitHub Desktop.
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
var students = []; | |
var rows = $("tr"); | |
for(var i = 1; i < rows.length; i++){ | |
students[i-1] = {}; | |
var row = rows[i]; | |
var name = (row.children[0].innerHTML+"").trim(); | |
students[i-1]["name"] = name.replace(" ","").replace(/\s\s+/g,' '); | |
var cgpa = (row.children[3].innerHTML+"").trim(); | |
students[i-1]["cgpa"] = parseFloat(cgpa); | |
var place = (row.children[4].innerHTML+"").trim(); | |
students[i-1]["place"] = place; | |
var registration = (row.children[2].children[0].innerHTML+"").trim() | |
students[i-1]["registration"] = registration; | |
} | |
students.sort(function(a,b){return b.cgpa - a.cgpa}); | |
var target = /^Souradeep/i; | |
for(var i = 0; i < students.length; i++){ | |
if(students[i].name.search(target) > -1) | |
console.log(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment