Q:

Find the widths and heights of various elements using jquery

0

Find the widths and heights of various elements using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>Find the widths and heights of various elements</title>
  </head>  
<body>
<p> jQuery Exercises</p>
<div style="height:75px;width:200px;padding:10px;margin:3px;border:1px solid blue;background-color:#81DAF5;"></div>
</body>
</html>

JavaScript Code :

console.log("The width of the Paragraph is:"+$("p").width());

console.log("The width of the window is:"+$("div").width());

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now