Quotes help make search much faster. Example: "Practice Makes Perfect"

Wednesday, November 7, 2012

Codecademy: Sample Solution to "...or not" under jQuery track



// Sample Solution to script.js
$('document').ready(function() {

//setting up the page (from provided.js)
addDivs();

$allTheDivs = $('div');

//select the third div
$thirdDiv = $allTheDivs.eq(2);

//use .not() to get all of the divs except the third one
$allButTheThird = $allTheDivs.not($thirdDiv);

$allButTheThird.addClass('selected');

});

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts