我有如下标签,
var width = 300;
var text = '<hr style="width:+'width'+px;background-color: red!important;color:red !important" >';
我想将width变量应用于style,任何人都可以修改我的代码。谢谢。
您好,您有语法错误
var width = 300;
var text = '<hr style="width:'+width+'px;background-color: red!important;color:red !important" >';