Style Odd or Even DIV Using jQuery | SJB -->

This website uses cookies to ensure you get the best experience. More info...

Pages

Style Odd or Even DIV Using jQuery

Style Odd or Even DIV Using jQuery | Virtual Species
DIV 1
DIV 2
DIV 3
DIV 4
DIV 5
DIV 6
DIV 7
DIV 8
DIV 9
DIV 10

Below is the script that is used to generate above functionality_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$(document).ready(function () {
    $("#resetODD").click(function () {
        $(".oddDiv").css("color""lime");
        $(".oddDiv").css("background-color""teal");
    });
    $('#resetEVEN').click(function () {
        $('.evenDiv').css('color''red');
        $('.evenDiv').css('background-color''blue');
    });
    $('#resetALL').click(function () {
        $('.oddDiv').css('color''white');
        $('.oddDiv').css('background-color'"black");
        $('.evenDiv').css("color"'white');
        $('.evenDiv').css("background-color""black");
    });
});

No comments:

Post a Comment