1

Possible Duplicate:
jQuery - remove style added with .css() function

I want to remove the style property from the div , i cannot use the removeAttribute and removeProperty as removeAttribute removes whole style and remove Property doesnot works in ie. Is there any other way to do it.

<div style="visiblity:hidden;margin-right:10px;margin-left:10px">

I want to remove only visibility style property.

Community
  • 1
  • 1
Kunal Vashist
  • 2,286
  • 6
  • 26
  • 56

5 Answers5

0

Use the .css as such

$(elementSelect).css('marginRight', null);

or

$(elementSelect).css('marginRight', '0px').css('visibility', 'visible');
Gareth Parker
  • 4,912
  • 2
  • 17
  • 42
0

You can use css function of jQuery

$('div').css({'visibility':'visible'});
BenMorel
  • 31,815
  • 47
  • 169
  • 296
muck41
  • 288
  • 1
  • 9
0

you can try this one :

$('div').css('visibility', '')
chickens
  • 14,980
  • 4
  • 51
  • 50
Ankur Ghelani
  • 659
  • 4
  • 16
0

Do you mean:

<div id="testDiv" style="visiblity:hidden;margin-right:10px;margin-left:10px">Here</div>

$('#testDiv').attr('style', function(i, style) {
    return style.replace(/visiblity[^;]+;?/g, '');
});

Example: jsFiddle

Sudhir Bastakoti
  • 97,363
  • 15
  • 155
  • 158
-3

Add runat="server" and then you could override the Visibility parameter from the code-behind

Tim Cadieux
  • 409
  • 8
  • 20