1
是否有負選擇器? https://api.jquery.com/attribute-contains-selector/Jquery屬性不包含選擇器
例如,要查詢所有屬性的名稱還沒有一個子男人
我嘗試了很明顯,但沒有工作
輸入<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>attributeContains demo</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<input name="man-news">
<input name="milkman">
<input name="letterman2">
<input name="newmilk">
<script>
$("input[name*!='man']").val("has man in it!");
</script>
</body>
</html>
Uncaught Error: Syntax error, unrecognized expression:
這一個是非常接近https://api.jquery.com/attribute-not-equal-selector/,但它不是平等,我想不包含。
而這一個jQuery "not contains" selector不工作,因爲我沒有文本值,窗體的創建方式值是在value屬性內。