screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>jQuery Get Element Height and Width</title> <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <style> #exampleElement { background-color: lightblue; padding:30px; margin-bottom: 10px; } </style> </head> <body> <h3>Jquery Get Element Height and WidthS</h3> <div id="exampleElement">This is Demo Element</div> <div id="result"></div> <script> $(document).ready(function () { // Get the height and width of the element with the id "exampleElement" var height = $("#exampleElement").height(); var width = $("#exampleElement").width(); // Display the height and width on the webpage $("#result").html("Height: " + height + "px<br>Width: " + width + "px"); }); </script> </body> </html>