http://awrdev.g3tech.in/sel.html

It illustrates how you can do a javascript or jQuery method on a
particular HTML DOM element or a class of elements.

the id= field is used to identify a particular element.You can only
have one id of the same name per page.

The class= field is used to aggregate a class of elements. You can repeat them.

There is much more to it.

CSS selectors and jQuery selectors are identical. jQuery has some
changes but largely you can rely on CSS3 selectors.

Here is the code.

$(function() {
        $('#d').click(function() {
                $('#divex').css({border: "5px solid blue" });
        });
        $('#l').click(function() {
                $('#listex').css({border: "5px solid blue" });
        });
        $('#sec').click(function() {
                $('#listex li:eq(1)').css({border: "5px solid blue" });
        });
        $('#for').click(function() {
                $('#listex li:eq(3)').css({border: "5px solid blue" });
        });
        $('#pa').click(function() {
                $('#paraex').css({border: "5px solid blue" });
        });
        $('#res').click(function() {
                $('#paraex,#listex,#divex').css({border: "none"});
                $('#listex li').css({border: "none"});
        });
})


-- 
Gayatri Hitech
http://gayatri-hitech.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to