Javascript examples for jQuery Method and Property:attr
JQuery read attribute value with spaces
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w w w .j a va2 s .c o m*/ var type=$(".movie").attr("type"); console.log(type); }); </script> </head> <body> <div type="Text with spaces" eventid="57" class="movie"> ... </div> </body> </html>