onclick button border color change css w3schools code example

Example 1: onclick button border color change

function clickimageone(el){
	el.style.border = "1px solid blue";
	document.getElementById("border2").className="borderorange";
}

Example 2: onclick button border color change

<div class="image"><img src="img/500.png" onclick="clickimageone(this)" class="border1" style="height: 500px; max-height: 150px; max-width: 300px; top: 50px; left: 50px"></div>
<div class="image"><img src="img/1000.png" onclick="clickimagetwo(this)" class="border2" style="height: 500px; max-height: 150px; max-width: 300px; top: 50px; left: 100px"></div>

Tags:

Css Example