Looking for assistance with a function that takes an item ID as input and changes its border when pressed. The goal is to increase the border width by 2px when there is no border, and remove the border completely when pressed again. Currently, only the first condition seems to be working properly. Seeking help to troubleshoot this issue.
function PIG(x) {
if (!(document.getElementById(x).style.border = "none")) {
document.getElementById(x).style.border = "2px solid green";
}
else if(!(document.getElementById(x).style.border = "2px solid green")){
document.getElementById(x).style.border = "none";
}
}