Attribute Contains Selector [name*=”value”]


<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>attributeContains demo</title>
<script src="https://code.jquery.com/jquery-3.5.0.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>
 
 
Reference:
https://api.jquery.com/attribute-contains-selector/


Article ID: 41
Created On: Wed, Sep 30, 2020 at 5:53 AM
Last Updated On: Wed, Sep 30, 2020 at 5:53 AM
Authored by: Saeed Nobakht [[email protected]]

Online URL: https://www.navel.ir/article/attribute-contains-selector-name*=”value”-41.html