Found 10483 Articles for Web Development

jQuery :hidden Selector

AmitDiwan
Updated on 05-Nov-2019 10:24:23

255 Views

The :hidden selector in jQuery is used to select all hidden elements.SyntaxThe syntax is as follows −$(":hidden")ExampleLet us now see an example to implement the :hidden() selector −    $(document).ready(function(){       $("h2:hidden").show();    }); Fill the form ID: Rank: Fav. Subjects: Maths: English OutputThis will produce the following output. Here, we are displaying the hidden element −

jQuery :header Selector

AmitDiwan
Updated on 05-Nov-2019 10:22:39

240 Views

The :header selector in jQuery is used to select all header elements to .SyntaxThe syntax is as follows −$(":header")ExampleLet us now see an example to implement the :header() selector −    .demo {       background-color: blue;       color: white;       font-size: 18px;       border: 2px orange solid;    }    $(document).ready(function(){       $(":header").addClass("demo");    }); Cricket Rankings ODI 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 :has() Selector with example

AmitDiwan
Updated on 05-Nov-2019 10:19:03

164 Views

The :has() selector in jQuery is used to select elements that contain at least one element matching the specified selector.SyntaxThe syntax is as follows −$(":has(selector)")Here, the parameter selector specifies the element to select.ExampleLet us now see an example to implement the :has() selector −    .demo {       background-color: blue;       color: white;       font-size: 18px;       border: 2px orange solid;    }    $(document).ready(function(){       $("tr:has(th)").addClass("demo");    }); 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 :gt() Selector

AmitDiwan
Updated on 05-Nov-2019 10:16:43

245 Views

The :gt() selector in jQuery is used to select elements with an index greater than mentioned in the index parameter.SyntaxThe syntax is as follows −$(":gt(index)")Here,The parameter index is the specified index. The elements above this index is selected.ExampleLet us now see an example to implement the :gt() selector −    .demo {       background-color: blue;       color: white;       font-size: 18px;       border: 2px orange solid;    }    $(document).ready(function(){       $("tr:gt(2)").addClass("demo");    }); 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 :focus Selector

AmitDiwan
Updated on 05-Nov-2019 10:12:27

517 Views

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

jQuery :first-of-type Selector

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

216 Views

The :first-of-type selector in jQuery is used to select elements, which are the first element of their parent.SyntaxThe syntax is as follows −$(":first-of-type")ExampleLet us now see an example to implement the :first-of-type() selector −    .demo {       background-color: red;       color: white;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $("p:first-of-type").addClass("demo");    }); This is the first line! This is the second line! This is the third line! One Two Three Four A B This is the last line. OutputThis will produce the following output −

jQuery :first-child Selector

AmitDiwan
Updated on 05-Nov-2019 10:06:38

316 Views

The :first-child selector in jQuery is used to select all elements, which are the first child of their parent.SyntaxThe syntax is as follows −$(":first-child")ExampleLet us now see an example to implement the :first-child() selector −    .demo {       background-color: red;       color: white;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $("p:first-child").addClass("demo");    }); This is the first line! This is the second line! This is the third line! One Two Three Four This is the last line. OutputThis will produce the following output −

UInt16.CompareTo() Method in C# with Examples

AmitDiwan
Updated on 05-Nov-2019 07:50:34

186 Views

The UInt16.CompareTo() method in C# is used to compare the current instance to a specified object or UInt16 and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (object val); public int CompareTo (ushort val;Above, the value for the 1st syntax is an object to compare. The value for 2nd syntax is an unsigned integer to compare.The return value is 0 if the current instance is equal to value. It’s less than zero if the current instance is less than val. The return value is more than zero if the current instance is greater than the ... Read More

jQuery :first Selector

AmitDiwan
Updated on 05-Nov-2019 07:37:24

258 Views

The :first selector in jQuery is used to select the first DOM element.SyntaxThe syntax is as follows −$(":first")ExampleLet us now see an example to implement the :first() selector −    .demo {       background-color: red;       color: white;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $("input:first").addClass("demo");    }); Job Application Applicant Name: Rank: Resume: OutputThis will produce the following output −

jQuery :file Selector

AmitDiwan
Updated on 05-Nov-2019 07:24:41

599 Views

The :file selector in jQuery is used to select all input elements with type=”file”.SyntaxThe syntax is as follows −$(":file")ExampleLet us now see an example to implement the :file() selector −    .demo {       background-color: blue;       color: white;       font-size: 16px;       border: 2px blue dashed;    }    $(document).ready(function(){       $(":file").addClass("demo");    }); Job Application Applicant Name: Rank: Resume: OutputThis will produce the following output −

Advertisements