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 to use HTML-CSS on outputting data conditionally?

    How to create embossed borders in HTML, CSS? [closed]

    How can I add a transition effect when opening my custom modal window?

    How to apply different CSS styles to 2 elements with the same class name?

    how to add two widths to one class in css

    How can I automatically highlight a specific character in link text using JQuery + CSS?

    How to make HTML design of a website extensible, reusable and flexible?

    How to create 10 CSS classes, each having 10% darker gray background with LESS?

    How to fast-blur in css/js?

    How to make this working Java-script more efficient

    How can I apply same style from element that changes in HTML to one that doesn't change in HTML?

    How to use jquery .css in a javascript variable

    How to minified all js and css files using gruntfile.js in sails.js

    How to fix this mouse hover transform scale effect (animation provided)

    How to make images autoscale regardless of height (like on tumblr blogs)

    How to visually position image before heading element

    How to reduce CSS animation on mouse over?

    How to add a gradient/filter in the image in CSS

    How to use sprite images in html/css and toggle change with jQuery

    How to create a triangle in CSS3 using border-radius

    how to set button background such that it takes up height and width of parent div? what css property affects which dimension?

    How to ensure broswer does not cache my JS/CSS [duplicate]

    Overwriting a CSS Class How to?

    How to correctly set the column widths on my HTML table?

    How can i get an image inside an li to disregard padding with css

    How to remove zoom effect of tile(metro ui css) using javascript

    How do I link JS file from other folder to a page?

    How to override default CSS in modern GWT applications?

    How do I go from fixed width to percentage width in a CSS stylesheet?

    How to center a div with dynamic & static content?