how to remove sub attribute of style
http://stackoverflow.com/questions/16644640/how-to-remove-sub-attribute-of-style
HTML
<input type="button" value="remove the attribute" onclick="removeAttr()" />
<div class="ui-state-default ui-jqgrid-hdiv" style="width: 1085px; display: none; visibility: visible; ">test</div>
JavaScript
function removeAttr() {
$('div.ui-state-default.ui-jqgrid-hdiv').each(function () {
var st = this.getAttribute('style').split(';').map(function (a) {
return a.toLowerCase().indexOf('display')>-1 ? '':a;
}).join(';');
this.setAttribute('style', st); //$(this).attr('style',st)
alert('TEST: display property == '+ $(this).css('display') + ', style attribute == ' + this.getAttribute('style'));
});
}
/*
function removeProp() {
var el = $('div.ui-state-default.ui-jqgrid-hdiv').css('display', 'block'); // default value
alert('TEST: display property == ' + el.css('display') + ', style attribute == ' + el.attr('style'));
}
*/