【发布时间】:2013-02-16 23:57:27
【问题描述】:
我想用 jquery 选择一个 VML 元素而不使用 'id' 或 'class' 但我的尝试没有成功。
<v:oval id="vmlElement" style='width:100pt;height:75pt' fillcolor="red"> </v:oval>
$(document).ready(function(){
//don't work
var oItem = $("v");//from here I should look for the n-th 'v' element, but for this example it is not necessary
$(oItem).attr("fillcolor", "green")
//alert($(oItem).attr("fillcolor"));
//This worked, but I can't use select to id, or class
$('#vmlElement').eq(0).attr("fillcolor", "green");
});
我知道 VML 太旧了,最好使用 SVG 。但是由于我们需要与旧版浏览器兼容,我们必须使用VML。对于所有Normal - Browser,我们正在使用 SVG,一切都像魅力一样运行。
非常感谢。
【问题讨论】:
标签: javascript jquery html dom vml