Selecting class inside div in jquery - Javascript jQuery Selector

Javascript examples for jQuery Selector:class

Description

Selecting class inside div in jquery

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//w ww . j  av  a  2 s.c  o  m
$('#cool .redirect').attr('href', 'google.com');
    });

      </script> 
   </head> 
   <body> 
      <div id="cool" style="width: 80%;height: 80%;margin: auto;"> 
         <a href="#" class="redirect"> cool</a> 
      </div>  
   </body>
</html>

Related Tutorials