How can I get a value from an inline style attribute, remove the ‘%’, and place it inside the closest (or the next) input value attribute?
<div>
<div>
<div style="width: 52%;"></div>
</div>
<input type="hidden" name="item_1" value="0">
</div>
<div>
<div>
<div style="width: 52%;"></div>
</div>
<input type="hidden" name="item_2" value="0">
</div>
I need to get the “52” of each <div style="width: 52%;"> and put it inside the closest input value replacing the “0”. How can I do this in jQuery? Thanks
Here’s the fiddle: http://jsfiddle.net/7GA4n/