Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function () { $("[class ~= 'myCls']").append(" - This element has myCls class"); }); </script> </head> <body> <h1>CSS Selector: element[attribute ~= 'value'] </h1> <div class="myCls test"> Inside First Div </div> <div class="my_Cls test"> Inside Second Div </div> <div class="test1 test2"> Inside Third Div </div> <div class="myclass myCls test"> Inside Fourth Div </div> <span class="myCls"> <p>Paragraph 1</p> Inside span </span> </body> </html>
Result: