JQuery Selectors





JQuery Bible
    <!—->
   
   
        .Yellow{background-color:#ffd800;}
   



   
       


            form>div tag.” />
       


       


            form>div tag.” />

            form>div tag.” />
       


       
       

This is a paragraph


   
   


        div tag.” />
   


   

   
    Select


    $(function () {
   var $Button=$(“#MyButtonOne”);
   var $form = $(“form”);
   $Button.click(function () {
            //–Select entire form tag————–
       var $SelectForm = $(“form”).addClass(“Yellow”);

       //—-Select all textboxes————-
       var $Select = $(“input:text”).addClass(“Yellow”);

       //—-Select textboxes with ‘yellow’ class ————-
       var $Select = $(“input:text.yellow”).addClass(“Yellow”);

       //—-Select textboxes inside the ‘form’ with ‘yellow’ class ————-
       //Note: form>input:text.yellow can not be used bcz textboxes are not direct child of form.
       var $Select = $(“form input:text.yellow”).addClass(“Yellow”);

       //—-Select textboxes inside the ‘form’ with ‘yellow’ & ‘red’ class ————-
       //Note: form>input:text.yellow can not be used bcz textboxes are not direct child of form.
       var $Select = $(“form input:text.yellow.red”).addClass(“Yellow”);

       //—-Select textboxes inside the ‘form’ ————-
       var $Select = $(“form>div#i-am-alone>input:text”).addClass(“Yellow”);

       // var $Select = $form.find(“input:text.yellow.red”).addClass(“Yellow”);

       // var $textBox = $(“div.div> input:text”).addClass(“Yellow”);
});
});


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s