Javascript examples for jQuery Method and Property:css
Change an individual element based on a class jquery callback function
<html lang="en"> <head> <style> .myClass {// w w w . jav a 2 s . c o m width: 300px; height: 300px; background: #f00; } </style> </head> <body translate="no"> <div class="myClass"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $('.myClass').click( function(){ $(this).css('width', '30%'); console.log("test"); }); </script> </body> </html>