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 () { $("div[class ^= 'myCls']").append(" - This element has CSS class name starting with myCls"); }); </script> </head> <body> <h1>CSS Selector: element[attribute ^= 'value']</h1> <div class="myClstest"> Inside First Div </div> <div class="my_Cls test"> Inside Second Div </div> <div class="myCls_Class"> Inside Third Div </div> <div class="testmyCls"> Inside Fourth Div </div> <span class="myCls"> <p>Paragraph 1</p> </span> </body> </html>
Result: