Javascript examples for jQuery Selector:attribute value
select element by custom attr
<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(){//w w w . ja v a 2 s . c o m var text = $('[maxchars]').text(); console.log(text); }); </script> </head> <body> <p maxchars="255">test</p> </body> </html>