Remove a style value by property name : removeProperty « Style « JavaScript Tutorial






<html>
<head>
<title>Style Example</title>
<script type="text/javascript">
    function useMethods() {
        var oDiv = document.getElementById("myDiv");
        alert(oDiv.style.getPropertyValue("background-color"));
        oDiv.style.removeProperty("background-color");
        alert(oDiv.style.getPropertyValue("background-color"));
    }
</script>
</head>
<body>
<div id="myDiv" style="background-color: red; height: 50px; width: 50px"></div><br />
<input type="button" value="Use Methods" onclick="useMethods()" />
</body>
</html>








22.12.removeProperty
22.12.1.Remove a style value by property name