Remove a specific inline style with Javascript|jQuery

For those that aren’t using jQuery, you can delete specific styles from the inline styles using the native removeProperty method. Example:

elem.style.removeProperty('font-family');

Of course, IE < 9 doesn’t support this so you’ll have to use

elem.style.removeAttribute('font-family');

so a cross browser way to do it would be:

if (elem.style.removeProperty) {
    elem.style.removeProperty('font-family');
} else {
    elem.style.removeAttribute('font-family');
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)