I'm trying to modify the width of a div. What am I doing wrong?
$('#foo')
[<div class="bar" id="foo" style="width: 40%"></div>]
$('#foo').css('style','width:50%')
[<div class="bar" id="foo" style="width: 40%"></div>]
I'm trying to modify the width of a div. What am I doing wrong?
$('#foo')
[<div class="bar" id="foo" style="width: 40%"></div>]
$('#foo').css('style','width:50%')
[<div class="bar" id="foo" style="width: 40%"></div>]
Actually you can follow either one of the following two methods.
$('#foo').css('width','50%')
Or
$('#foo').css({width:'50%'})
The second method is used to change multiple properties at one.