Javascript examples for jQuery:CSS
Change CSS based on certain DIV content
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(function(){/* ww w. ja v a 2s. co m*/ var chktxt = $.trim($('.checkbox').text()); if(chktxt == 0){ $('#checkbox').hide(); }else{ $('#checkbox').show(); } }); </script> </head> <body> <div class="checkbox"> 1 </div> <input type="checkbox" id="checkbox" value=""> </body> </html>