Get width in pixels from element with style set with %?

后端 未结 7 1617
庸人自扰
庸人自扰 2021-01-31 00:57

I have this element:

I want to get it\'s width in pixels. I just tried this:

7条回答
  •  北海茫月
    2021-01-31 02:00

    This jQuery worked for me:

    $("#banner-contenedor").css('width');
    

    This will get you the computed width

    http://api.jquery.com/css/

提交回复
热议问题