How do I get a div element width, if it do not set?
<div class="test">Text text</div>
alert($('.test').width()); - now i get my all page width, but not div width.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since divs are by default blocks, it inherits it’s parents 100% width,
therefore: your div Test would have to be 100% of your parent and the value you get alerted is correct.