Question: I created a function called disableLink. I want the function to prevent an anchor tag from going to the references href when clicked on. I
I created a function called disableLink. I want the function to prevent an anchor tag from going to the references href when clicked on. I setup an event listener for when the anchor is clicked. Finish the function so the link is disabled.
const myLink = document.getElementById('myLink'); function disableLink(e) { // your solution here. } myLink.addEventListener('click', disableLink, false);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
