我的页面(引导)上有一个进度条,如下所示:
<;div id=“theprogressbar”class=“进度条progress-bar-u”
role=“progressbar”aria valuenow=“75%”aria valuemin=“0”
aria valuemax=“100”style=“宽度:75%”gt;
我想通过jQuery更新它,我已经完成了大部分工作并计算了需要输入的新值,但不确定如何将aria valuenow和style=“width:值作为目标
假设jQuery将新值+%作为名为newprogress的变量提供给我:
$(“#程序条”)*(请帮我完成这行)*(新进展)
$('theprogressbar').attr('aria-valuenow',newprogress.).css('width',newprogress);
如果要设置以下代码的百分比,则默认值为px
$('theprogressbar').attr('aria-valuenow',newprogress.css('width',newprogress+'%');