Javascript examples for jQuery Selector:lang
The :lang() selector selects elements by the language attribute starting value.
The following code shows how to select all <p> elements with a lang attribute value that starts with "it":
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("p:lang(it)").css("background-color", "yellow"); });//from w w w .j a va 2s . co m </script> </head> <body> <p>I live in Italy.</p> <p lang="it">Ciao bella!</p> <p lang="it-it">Ciao bella!</p> <p lang="en-it">Ciao bella!</p> <p lang="it-en">Ciao bella!</p> </body> </html>