I have tried so many things but it hasn't worked. I am not using react in this project so not sure how i can call the shoeAlert() function when the button is clicked. PLEASE HELP!!
import '../Nav/nav.styles.scss';
const Nav = () => {
function showAlert(e) {
e.preventDefault();
console.log("I'm an alert");
};
return ( `
<div class='nav'>
<div>
<p>Logo</p>
<button id='btn' onclick="{this.showAlert}"> Click Me</button>
</div>
</div> `);
}
export { Nav };