I want to click on one of several buttons and show it has been clicked on by changing a property e.g.:
function clickMeFunction() {
var curElement = document.activeElement;
curElement.style.borderColor = "red";
}
<button onclick="clickMeFunction()">Click me to border color red</button>
This works on Chrome but not on Safari or Firefox. The best way to see the problem is to run the W3 "try it" for activeElement, and click on the button.
On Chrome, it says the active element is BUTTON but the active element is BODY on Safari and Firefox. Yet W3 also says that all major browsers support activeElement. What am I missing and how do I select the button that I just clicked on so I can highlight it on all browsers?
thank you