So I have a basic html page and basic Javascript in the head. I'm trying to redirect using Javascript once the function is activated through onClick but window.location.href wont work. window.alert works and everything else.
HTML
<html>
<head>
<title>Testing Aff Links</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
function myfunc(){
window.location.href="http://youtube.com";
}
</script>
</head>
<body>
Link <a href="http://google.com" class="link" onClick="myfunc()">Link #1</a>
</body>
</html>