jQuery - css() not working properly in firefox
jquery
Solution
The CSS tag 'margin & padding' is actually a shorthand for the four separate margin/padding values, top/left/bottom/right. Use css('marginTop'), etc. - note they will have 'px' on the end if you have specified them that way.
Use parseInt() around the result to turn it in to the number value.
<input name="margin-top" />
<input name="padding-top" />
OR
<input name="marginTop" />
<input name="paddingTop" />
This will give you the value. Using this technique you can get the value of margin and padding.
Problem
I am using `.css()` to get style from a element. But in firefox `.css()` is not getting value of `margin` and `padding` from element. Please see the fiddle: http://jsfiddle.net/howtoplease/fMTsW/ This is my jquery code: ``` $(document).ready(function(){ $('input').each(function(){ this.value = $('h3').css(this.name); }); }); ``` My html code ``` <h3 style="margin:20px;padding:20px;font-size:30px;font-family:'open sans';"> I am heading 3 </h3> <input name="margin" /> <input name="padding" /> <input name="font-size" /> <input name="font-family" /> ```