Detecting width:auto in jQuery - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

Detecting width:auto in jQuery

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-1.4.2.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from ww w  . ja v a 2s  .  c om
console.log($('#s')[0].style.width)
    });

      </script> 
   </head> 
   <body> 
      <div id="s" style="width:auto; border:1px black solid">
         asdasd
      </div>  
   </body>
</html>

Related Tutorials