【发布时间】:2012-06-23 14:03:16
【问题描述】:
<div class="test" style="position:absolute; font-size: 12; right:400px; top:100px;"><p>Hello</p></div>
<div class="test" style="position:absolute; font-size: 14; right:200px; top:140px;"><p>Hello</p></div>
我想做类似的事情
var positionvalue= $('.test'). get value where position is exist inside style attribute
var topvalue= $('.test'). get value where top is exist inside style attribute.
有没有什么简单的方法可以通过 jquery 来实现呢?
意思是不需要将样式读入变量,然后拆分为数组数组,循环通过比较属性键来获取值。
【问题讨论】:
标签: jquery properties styles inline