Reputation: 11916
Can any one tell me, how do I remove style attribute from this below div?
<div class="ui-state-default ui-jqgrid-hdiv" style="width: 1085px;">
I have tried the below, but,it does not remove it.
$('.ui-state-default ui-jqgrid-hdiv').removeAttr('style')
Thank you
Upvotes: 1
Views: 3907
Reputation: 148120
Use dot
or comma
to join the classes in selector
$('.ui-state-default.ui-jqgrid-hdiv').removeAttr('style')
Upvotes: 11
Reputation: 15404
The problem is with your selector.
$('.ui-state-default ui-jqgrid-hdiv').removeAttr('style')
needs to be
$('.ui-state-default.ui-jqgrid-hdiv').removeAttr('style')
Upvotes: 1
Reputation: 23054
Alternatively, this might be of help?..
var width = $(window).width(); //Just assuming screen width
$('#gridId').setGriWidth(width);
Upvotes: 1