Do NOT select div which have empty title - Javascript jQuery

Javascript examples for jQuery:Selector

Description

Do NOT select div which have empty title

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(){/*  www.  j  ava  2 s.  c om*/
console.log($('div[title=""]')[0])
console.log($('div:not([title=""])')[0])
console.log($('div').not('[title=""]')[0])
    });

      </script> 
 </head> 
 <body> 
  <div title=""></div> 
  <div title="dfd"></div>  
 </body>
</html>

Related Tutorials