So, I'm defining some CSS values with jQuery. I'm defining multiple values like so:
$('#elementId').css({
height : '60px',
width : '268px',
display : 'block',
float : 'left'
});
Note I'm also adjusting the 'float'. Although it does work, 'float' (obviously) is a datatype, and my editor identifies it a such. I was wondering if there's a more proper way to change the float CSS value, rather than using the reserved float datatype. I suppose this is kind of an OCD issue, but I like to do things right.
Thanks.
Try wrapping it in inverted commas:
$('#elementId').css({
'height': '70px',
'width': '280px',
'display': 'inline-block',
'float': 'left',
});
See this example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With