jquery find element by class code example

Example 1: find name description jquery children()

{
    'name': $(this).children('input[name="paramName"]').val(),
    'value': $(this).children('input[name="paramPrice"]').val()
};

Example 2: find class using jquery

var myVar = $("#start").find('.myClass').val();

Example 3: jquery select input with class

$("input.myClass:checkbox")

Example 4: jquery class selector

$('.class').jquery_function();

Example 5: jquery find tag and class

$(".txtClass")                  =>  getElementsByClassName()

$("#childDiv2 .txtClass")       =>  getElementById(),
                                    then getElementsByClassName()

$("#childDiv2 > .txtClass")     =>  getElementById(),
                                    then iterate over children and check class

$("input.txtClass")             =>  getElementsByTagName(),
                                    then iterate over results and check class

$("#childDiv2 input.txtClass")  =>  getElementById(),
                                    then getElementsByTagName(),
                                    then iterate over results and check class

Example 6: jquery find

$( "li.item-ii" ).find( "li" ).css( "background-color", "red" );