I've been trying for like an hour to find the right value to do that, and now, only 1 link is highlighted, but i want all the links to get bg's color in yellow, can someone tell me please, what i did or what i am doing wrong? idk how to put more id's in just 1 button without any extra codes...
<script type="text/javascript">
function hl(divId) {
var div = document.getElementById(divId);
div.className = "highlight";
}
function unhl(divId) {
var div = document.getElementById(divId);
div.className = "1";
}
</script>
<style type="text/css">
.highlight, .highlight a {
background-color: yellow;
font-weight: bold;
}
</style>
</head>
<body>
<div id="thinger">
Visit <a id="1" href="https://instagram.com/">Instagram</p></a>
<p>Visit <a id="2" href="https://www.facebook.com/">Facebook</p></a>
<p>Visit <a id="3" href="https://discord.gg/">Discord</p></a>
</div>
<button onclick="hl('1');">Highlight</button>
<button onclick="unhl('1');">Unhighlight</button>
onclick="hl('1');"'+'onclick="hl('b');"withonclick="hl('1'); hl('b');"?<button onclick="hl('1');"'+'onclick="hl('b');">two onclicks in one button is wrng and causes erreor