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 div element has CSS class name starting with myCls"); }); </script> </head> <body> <h1>CSS Selector: element[attribute |= 'value'] </h1> <div class="myCls"> Inside First Div </div> <div class="classfordiv"> Inside Second Div </div> <div class="myCls-test"> Inside Third Div </div> <div class="myClsone"> Inside fourth Div </div> <span class="myCls"> <p>Paragraph 1</p> </span> </body> </html>
Result: