I'm trying to compare an if else to add a style (border), as you see in my next code add an id to an element to apply the style, the style that works is the style that you add by default, if not Nothing is satisfied in the if and else (in case there is an error or something similar).
var myElement = document.getElementById("demo");
if (myElement == 'company') {
myElement.style.border = '2px solid red';
}
else {
myElement.style.border = "2px solid blue";
}
//este es el estilo por default
myElement.style.border = "2px solid green";
<!DOCTYPE html>
<html>
<head>
<title>Example CSS3</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<p id="demo">company</p>
<script src="script.js"></script>
</body>
</html>