- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to make jQuery attribute selector case insensitive?
To make jQuery attribute selector case insensitive, create two buttons and manipulate the input with attribute selector.
Example
You can try to run the following code to make jQuery attribute selector case insensitive:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $( "input[name*='myclass' i]" ).css("background-color", "yellow"); }); $("#insensitive").click(function(){ $( "input[name*='myclass' i]" ).css("background-color", "blue"); }); // myclass input blue $("#sensitive").click(function(){ $( "input[name*='myclass']" ).css("background-color", "blue"); }); }); </script> </head> <body> <input name="myclass"> <input name="MYCLASS"> <br> <button id="insensitive">Case insensitive</button> <button id="sensitive">Case sensitive</button> </body> </html>
- Related Articles
- jQuery [attribute!=value] Selector
- How to use *= operator in jQuery attribute selector?
- How to make a case-insensitive query in MongoDB?
- How to combine a class selector and an attribute selector with jQuery?
- How do we use # in jQuery Attribute Selector?
- How do I make my string comparison case insensitive?
- How do I make case-insensitive queries on MongoDB?
- How to pass a variable into a jQuery attribute-contains selector?
- How do we use jQuery Attribute selector with a period?
- How to write a jQuery selector to find links with # in href attribute?
- How do we make my string comparison case insensitive in java?
- How to use case-insensitive switch-case in JavaScript?
- Is it possible to make a case-insensitive query in MongoDB?
- How to perform case-insensitive search in Oracle?
- MySQL case-insensitive DISTINCT?

Advertisements