Hey guys am new to javascript web development.I have been through preventDefault()
through my code.But when i used it it returns the error ..My code
<html>
<body>
function preventDef(event) {
event.preventDefault();
}
document.querySelector('a').addEventListener("click",
preventDef(event),false);
</script>
<a href="www.google.com">click here</a>
</body>
</html>
When i use this code and clicked on the link it redirects me to google.com ..what i need is the event must be blocked my preventDefault()
function..
Hope you guys can help me out ..Thanks