Home » Categories » jQuery

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 Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Comments Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
jQuery multiple events to trigger the same function
Viewed 419 times since Mon, Sep 28, 2020
How to apply style to parent if it has child with CSS?
Viewed 431 times since Thu, Oct 8, 2020
How to get Response Header location from jQuery Get?
Viewed 585 times since Wed, Sep 30, 2020
Hidden image after redirect by check filename
Viewed 477 times since Wed, Sep 30, 2020