1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 关于style设置方法 obj.setAttribute(style.)和obj.style.stylename

关于style设置方法 obj.setAttribute(style.)和obj.style.stylename

时间:2018-06-06 14:11:38

相关推荐

关于style设置方法 obj.setAttribute(style.)和obj.style.stylename

1、使用obj.setAttribute("style"."")方法;

obj.setAttribute("style","-webkit-clip-path: polygon(0% 0%, 66% 0, 33% 100%, 0% 100%);float:none;");obj.setAttribute("style","position:absolute;background-image:url(1.jpg);");

如果在一个js代码中,同时对一个obj对象使用setAttribute方法设置style,后一个设置会覆盖前面一个的设置。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。