Reset element color to default stylesheet color (Jquery, Javascript)
        Posted  
        
            by leaf dev
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by leaf dev
        
        
        
        Published on 2010-03-23T14:05:03Z
        Indexed on 
            2010/03/23
            14:13 UTC
        
        
        Read the original article
        Hit count: 491
        
I need to be able to reset an input field back to its original color after it has been possibly changed via javascript to a different value. The problem is I do not want to hard code the value obviously in case the stylesheet changes. I would like to use the default color used on the page.
Is resetting the color like this fine, or is there a better way to do this?
$('#theinput').css('color', '');
© Stack Overflow or respective owner