Get border width from a div with plain javascript

前端 未结 6 2106
日久生厌
日久生厌 2020-12-30 23:44

I got this style applied to a div

div#content {
border: 1px solid skyblue;  
}

and i want to be able to alert the width of the border, I ha

6条回答
  •  死守一世寂寞
    2020-12-31 00:29

    According to W3Schools, this property is supported by major browsers. Thus you shouldn't have any difficulty in using it.

    However, using a JavaScript framework like jQuery would always help you not worrying about trivial issues like this.

提交回复
热议问题