I have a very basic html requirement where on some parameter value, I need to hide the hyperlink on the text and show the hover on the text.
Below is my test html.How should I handle my Javascript where when accesscode =10, I should show only hover not href?
<!DOCTYPE html>
<html>
<body>
<h1>test Heading</h1>
<p>Test screen.</p>
<a id="tagUrl" class="button" href='https://growthModeltest.com' target="_blank" rel="MonthlyReport">Learn More</a>
</body>
<script>
var accessCode= 10;
var hideElem = document.getElementById("tagUrl");
if(accessCode == 10){
//should not display the link, instead show the hover.
hideElem.href = '#';
}
</script>
</html>