I want to change the css of an element using jQuery.
$('p').css({
padding-left : '6px',
border-left : '5px solid #555'
});
It does not work.
However, when i use
$('p').css('padding-left','6px');
$('p').css('border-left','5px');
it works...
What am I doing wrong here?
Thanks
padding-left
as a variable, just wrap them in single quotes and you'll be all set. – mcpDESIGNS Mar 28 at 14:01