Handle an asterisk * in an id selector - Javascript jQuery

Javascript examples for jQuery:Tag Traversing

Description

Handle an asterisk * in an id selector

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(){/*from  ww w.  j av a 2  s. c  o m*/
$(document).ready(function()
{
   console.log($('[id="target-A*"]').length);
});
    });

      </script> 
   </head> 
   <body> 
      <div src="abc" quality="1" id="target-A*">  
      </div>
   </body>
</html>

Related Tutorials