Javascript examples for jQuery:CSS
Get CSS class name in JavaScript
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var ddd="<p class='Box_title'>Heading text here...</p>"; $('.container').append(ddd); console.log($('.container').children(':first-child').attr("class")); });/* w ww . ja va2s .com*/ </script> </head> <body> <div class="container"> </div> </body> </html>