Found 10483 Articles for Web Development

jQuery :even Selector

AmitDiwan
Updated on 05-Nov-2019 07:21:45

173 Views

The :even selector in jQuery is used to select even elements i.e. with even index number.Note − The :even selector deprecated in jQuery 3.4SyntaxThe syntax is as follows −$(":even")ExampleLet us now see an example to implement the :even() selector −    .one {       background-color: blue;       color: white;       font-size: 18px;       border: 2px blue dashed;    }    $(document).ready(function(){       $("tr:even").addClass("one");    }); Result Rank Points Player 1 100 Virat Kohli 2 80 Steve Smith 3 75 David Warner 4 60 Kane Williamson 5 50 Ben Stokes 6 45 Rohit Sharma OutputThis will produce the following output −

jQuery :enabled Selector

AmitDiwan
Updated on 05-Nov-2019 07:18:35

209 Views

The :enabled selector in jQuery is used to select all enabled input elements.SyntaxThe syntax is as follows −$(":enabled")ExampleLet us now see an example to implement the :enabled() selector −    .one {       background-color: orange;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $(":enabled").addClass("one");    }); Result Username: Password: OutputThis will produce the following output −

jQuery :empty Selector

AmitDiwan
Updated on 05-Nov-2019 07:13:15

252 Views

The :empty selector in jQuery is used to select all elements which are empty.SyntaxThe syntax is as follows −$(":empty")ExampleLet us now see an example to implement the :empty() selector −    .demo {       color: brown;       background-color: orange;       font-size: 16px;       border: 2px blue dashed;       width:100px;       height:70px;    }    $(document).ready(function(){       $("p:empty(.one)").addClass("demo");    }); Enter details ID: Rank: Fav. Subjects: Maths: English OutputThis will produce the following output −

jQuery :disabled Selector

AmitDiwan
Updated on 05-Nov-2019 07:07:30

294 Views

The :disabled() selector in jQuery is used to select all disabled input elements.SyntaxThe syntax is as follows −$(":disabled")ExampleLet us now see an example to implement the :disabled() selector −    .one {       color: brown;       background-color: orange;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $(":disabled").addClass("one");    }); ID: Rank: Fav. Subjects: Maths: English OutputThis will produce the following output −

jQuery :contains() Selector

AmitDiwan
Updated on 05-Nov-2019 07:03:51

507 Views

The :contain() selector in jQuery is used to select elements containing the specified text.SyntaxThe syntax is as follows −$(":contains(text)")Here, the parameter text is the text to find. The same elements are selected with the specified text.ExampleLet us now see an example to implement the :contains() selector −    .one {       color: brown;       background-color: orange;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $("p:contains(the)").addClass("one");    }); Examination Timings: 10AM - 1PM The examination hall details would be emailed to the students. OutputThis will produce the following output −

jQuery :checked Selector

AmitDiwan
Updated on 05-Nov-2019 07:00:05

337 Views

The :checked selector in jQuery is used to look for all the checked radio button or checkboxes and selects them.SyntaxThe syntax is as follows −$(":checked")ExampleLet us now implement the :checked selector in jQuery − Favourite Subject Maths: English    $( "input" ).on( "click", function() {       $( "#content" ).html( $( "input:checked" ).val() + " is the favourite subject" );    }); OutputThis will produce the following output −Select “Maths” radio button above −Now, select “English” radio button −

jQuery :checkbox Selector

AmitDiwan
Updated on 05-Nov-2019 06:56:05

443 Views

The jQuery :checkbox selector is used to select input elements with type checkbox.SyntaxThe syntax is as follows −$(":checkbox")ExampleLet us see an example to implement the :checkbox selector in jQuery −    $(document).ready(function(){       $(":checkbox").wrap("");    }); Fill the form ID: Rank: Fav. Subjects: Maths: English OutputThis will produce the following output −ExampleLet us see another example −    $(document).ready(function(){       $(":checkbox").wrap("");    }); Hobbies Player Name: Fav Sports Football: Cricket OutputThis will produce the following output −

jQuery :button Selector

AmitDiwan
Updated on 05-Nov-2019 06:54:51

498 Views

The jQuery :button selector is used to select button and input elements with type button.ExampleLet us now see an example to implement the :button selector −    $(document).ready(function(){       $(":button").css("border-width", "5px");    }); Username: Password: Demo Button OutputThis will produce the following output. The border of the “Demo Button” is changed using the :button selector −ExampleLet us now see another example −    .one {       color: white;       background-color: gray;       font-size: 16px;       border: 2px yellow dashed;    }    $(document).ready(function(){       $(":button").addClass( "one" );    }); ID: Rank: Demo Button OutputThis will produce the following output −

HTML DOM Window stop() Method

AmitDiwan
Updated on 15-Feb-2021 04:37:58

262 Views

The HTML DOM Window stop() provides user the functionality to stop loading the resources of a window without clicking the browser stop button.SyntaxFollowing is the syntax −window.stop()ExampleLet us see an example of HTML DOM Window stop() method − HTML DOM Window stop()    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;                   ... Read More

HTML DOM Window parent Property

AmitDiwan
Updated on 21-Dec-2021 07:51:23

849 Views

The HTML DOM Window parent property returns a reference to the parent window of the child window.SyntaxFollowing is the syntax −Returning reference of parent windowwindow.parentExampleLet us see an example of HTML DOM Window parent property − HTML DOM Window parent    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;                    HTML-DOM-Window-parent   ... Read More

Advertisements