1Syntax
2$("[attribute|='value']")
3
4<!DOCTYPE html>
5<html>
6<head>
7<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
8<script>
9$(document).ready(function(){
10 $("p[title|='Tomorrow']").css("background-color", "yellow");});
11</script>
12</head>
13<body>
14
15<p title="Tomorrow">This is a paragraph.</p>
16<p title="tomorrow">This is a paragraph.</p>
17<p title="Tom">This is a paragraph.</p>
18<p title="See You Tomorrow">This is a paragraph.</p>
19<p title="Tomorrow-the day after today">This is a paragraph.</p>
20
21<p>This selector selects all elements with a title attribute value equal to 'Tomorrow', or starting with 'Tomorrow' followed by a hyphen.</p>
22
23</body>
24</html>
25
1$('td[name ="tcol1"]') // matches exactly 'tcol1'
2$('td[name^="tcol"]' ) // matches those that begin with 'tcol'
3$('td[name$="tcol"]' ) // matches those that end with 'tcol'
4$('td[name*="tcol"]' ) // matches those that contain 'tcol'
1$("ul[data-group='Companies'] li[data-company='Microsoft']") //Get all elements with data-company="Microsoft" below "Companies"
2
3$("ul[data-group='Companies'] li:not([data-company='Microsoft'])") //get all elements with data-company!="Microsoft" below "Companies"
4