Skip to content

Instantly share code, notes, and snippets.

@sayham-sjb
Created February 17, 2018 07:41
Show Gist options
  • Save sayham-sjb/c0f695638d585f1a400841b9c2a637fe to your computer and use it in GitHub Desktop.
Save sayham-sjb/c0f695638d585f1a400841b9c2a637fe to your computer and use it in GitHub Desktop.
StyleOddOrEvenDIVUsingjQuery #js #VS
$(document).ready(function(){
$("#rstODD").click(function() {
$(".oddDiv").css("color", "lime");
$(".oddDiv").css("background-color", "teal");
});
$('#rstEVEN').click(function() {
$('.evenDiv').css('color', 'red');
$('.evenDiv').css('background-color', 'blue');
});
$('#rstALL').click(function() {
$('.oddDiv').css('color', 'white');
$('.oddDiv').css('background-color', "black");
$('.evenDiv').css("color", 'white');
$('.evenDiv').css("background-color", "black");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment