How to reset the style properties to their CSS defaults in javascript?


Tags: javascript,html,css,dynamic-html

Problem :

On a php generated page there are several elements like this:

<td class="defaultTDStyle" style="color:userDefinedCustomColor" id="myTDId"></td>

So there is a default style and I apply several extra styles that override the style defined in the CSS.

Is there a way to remove these added styles from javascript? It seems the obj.style.color="default" and obj.style.color="auto" not works. How can I reset the color to the CSS default from javascript?



Solution :

If recollection serves, obj.style.color="" should work... I don't know if it's right though.


    CSS Howto..

    How do I ONLY add a box-shadow to the bottom with the following css?

    How to align div horizontally in this case

    How do I go about targeting the literal “first-child” of a div, styling depending on element type

    How to use -webkit-appearance: searchfield-results-decoration?

    How to apply !important using .css()?

    CSS horizontal scroller, how to position “below” before “right”?

    How to convert SVG CSS animation to pure JS code

    How can I force a cached css file to be reloaded on a JSP (i.e. not PHP)?

    Want to duplicate css styles for an ID based style, how to do this with least duplication?

    how to pause css animation on hover using jquery

    How to set background image to keep its position while browser width is changing?

    :hover feature , How to approach the same result as js code by using css

    How to center video source in circle shape using css, html

    How to print the CSS stylesheet for PPI::HTML highlight? [closed]

    how to fit text inside a HTML div

    How to apply CSS class to a parent element?

    How to click on and off submenu's using javascript

    How to fix incorrect element size on browser scaling?

    How do I take multiple CSS files with the exact same selectors and force one to be used only on a specific div?

    Google Share button not showing properly if originaly hidden

    How to make a div move smoothly?

    I have the CSS & JS, how do I convert that to erb for my Rails app?

    How to give background image in CSS? [closed]

    how to position a css sprite as background for another class

    How to change background image based on screen size, possibly with Bootstrap

    How do I get these two columns to have the same height at all times - CSS?

    How to style a XUL textbox with CSS :focus

    How to fix image loading time with my image slider?

    How to give a border as a background in css without using image and without adding anything to mark-up?

    How to float 3 LI's to the left and 3 to the right and maintain original sequence?