jQuery | :lang() Selector
The :lang Selector is used to select all the elements which have the lang attribute with the specified value.
This attribute contains single value language_code which is used to specify the language of content. Some examples of languages are ” en” for English, “es” for Spanish etc. It takes a whole word as value such as lang=” en” or followed by a hyphen(-) like lang=” en-us”.
Syntax:
$(":lang(language)")
Example:
<!DOCTYPE html> <html> <head> <script src= </script> <script> $(document).ready(function() { $("p:lang(en)").css( "background-color", "coral"); }); </script> </head> <body> <center> <h1 style="color:green;"> GeeksForGeeks</h1> <h2>jQuery :lang Selector </h2> <p>GeeksforGeeks</p> <p lang="en"> A computer science portal for geeks.</p> </center> </body> </html> |
Output:

Supported Browsers: The browser supported by jQuery :lang Selector are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- CSS | :lang Selector
- jQuery | :not() Selector
- jQuery | :first Selector
- jQuery | * Selector
- jQuery | :last Selector
- jQuery | :lt() Selector
- jQuery | :odd Selector
- jQuery | :gt() Selector
- jQuery | :even Selector
- jQuery | #id Selector
- jQuery | :contains() Selector
- jQuery | :has() Selector with example
- jQuery | :last-child Selector
- jQuery | [attribute=value] Selector
- jQuery | :nth-of-type() Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh



