获取字符串元素的宽度而不附加
问题描述:
var dv = "<div style='width:300px;height:100px'></div>";
如何,我得到300像素的输出打印?
alert($.parseHTML(dv).width()) //outputs undefined.
var dv = "<div style='width:300px;height:100px'></div>";
如何,我得到300像素的输出打印?
alert($.parseHTML(dv).width()) //outputs undefined.
'$ .parseHTML(dv)'将返回数组'' – Rayon
'alert($。parseHTML(dv)[0] .style.width);' – Rayon