![](https://box.kancloud.cn/8c0fe88230888b327365383647bf2fc1_904x78.png)
~~~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<script>
$(function () {
$('input[value]').css('background','red');
$('input[value=123]').css('background','yellow');
$('input[value*=123]').css('background','orange');
$('input[value^=123]').css('background','red');
$('input[value$=123]').css('background','blue');
$('div[class=box]').css('background','pink');
$('div[class="box box2"]').css('background','green');
});
</script>
</head>
<body>
<!--
• [=] ★★★★★
• [^=] 以……起始 ★★★★★
• [$=] 以……结束 ★★★★★
• [*=] 包含……的 ★★★★★
• 引号的问题
-->
<div id="div1" class="box box2" miaov="妙味">aaaaaa</div>
<div id="div2" class="box" miaov="妙味">aaaaaa</div>
<input type="text" value="123_444">
<input type="text" value="457_123">
<input type="text" value="777123888">
<input type="text" >
<input type="text" value="123">
</body>
</html>
~~~