方法如下:
var myWidth = document.getElementById("#myChart");

var temp = myWidth.style.width=window.innerWidth+'px';
alert(temp);

其他高度获取:

alert($(window).height()); //浏览器当前窗口可视区域高度
alert($(document).height()); //浏览器当前窗口文档的高度
alert($(document.body).height());//浏览器当前窗口文档body的高度
alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin

相关文章:

  • 2022-02-25
  • 2021-07-07
  • 2021-10-27
  • 2021-07-03
  • 2022-12-23
  • 2021-12-26
猜你喜欢
  • 2022-01-07
  • 2022-02-06
  • 2021-11-29
  • 2021-11-29
  • 2021-12-08
相关资源
相似解决方案