📌  相关文章
📜  如何在 jQuery 中获取元素的宽度和高度?

📅  最后修改于: 2021-11-24 04:51:52             🧑  作者: Mango

在本文中,我们将找到 jQuery 中元素的宽度和高度。要查找元素的宽度和高度,可以使用 width() 和 height() 方法。 width() 方法用于检查元素的宽度。它不检查元素的内边距、边框和边距。 height() 方法用于检查元素的高度,但不会检查元素的内边距、边框和边距。

句法:

$("param").width()
$("param").height()

例子:

HTML


  

    
        How to get the width and height
        of an element in jQuery?
    
  
    
  
    
  
    

  

    

        GeeksforGeeks     

       

        How to get the width and height         of an element in jQuery?     

       
        GeeksforGeeks: A computer science portal     
    
               

  


输出: