function displayResult() { if(document.getElementById("b1").style.width=="300px") { document.getElementById("b1").style.background="Red"; } }
<input type="button" id="b1" onload="displayResult()" value="Button" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)