Javascript 如何获得进度条的宽度?
我有一个文件上载进度条,但它没有显示进度值。我检查了它,看到它的宽度属性正在进行,进度条是动态生成的,上载后它消失了:Javascript 如何获得进度条的宽度?,javascript,jquery,css,dom,html5-canvas,Javascript,Jquery,Css,Dom,Html5 Canvas,我有一个文件上载进度条,但它没有显示进度值。我检查了它,看到它的宽度属性正在进行,进度条是动态生成的,上载后它消失了: <div id="pic-progress-wrap" class="progress-wrap"></div> this is the only code can see when it is not uploading 这是不上传时唯一可以看到的代码 以及在上传时 <div class="progress progress-strip
<div id="pic-progress-wrap" class="progress-wrap"></div> this is the only code can see when it is not uploading
这是不上传时唯一可以看到的代码
以及在上传时
<div class="progress progress-striped active"><div class="progress-bar progress-bar-success" style="width: 23%;"></div></div>
可以看到该代码是动态生成的
我想得到width属性值,并将其显示在范围内 您应该或使用jQuery在元素的属性更改时绑定侦听器函数。如果您只想获取宽度值,请使用:document.getElementById(“abc”).children[0]。style.width,其中abc是父div id