Created
December 7, 2011 06:14
-
-
Save dalyons/1441680 to your computer and use it in GitHub Desktop.
js question
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
Without using jQuery or other external libraries, but assuming a modern browser environment, | |
write some Javascript to sort the list with id players by their data-rank attribute in | |
ascending order: | |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<ul id="players"> | |
<li data-rank="3">3 - Bobby Orr</li> | |
<li data-rank="1">1 - Wayne Gretzky</li> | |
<li data-rank="2">2 - Trevor Linden</li> | |
</ul> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment