select Target attribute with special character - Javascript jQuery Selector

Javascript examples for jQuery Selector:attribute value

Description

select Target attribute with special character

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
      <script>
    $(document).ready(function(){
        jQuery("[data-id='?']").text('hello');
    });/*from w  w w  .java  2 s.c  om*/

      </script> 
   </head> 
   <body> 
      <div data-id="?"></div> 
      <div data-id="2"></div>  
   </body>
</html>

Related Tutorials