The code I currently have is not working, and it seems to be because of the if
statement as if I remove it, it works great, but then it doesn't do what I need, obviously.
What is wrong with this code?
<!DOCTYPE html>
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<input type="button" id="sample0" onclick="javascript:setval(0)" />
</body>
<script>
var mysample = 0;
function setval(varval) {
mysample = varval;
alert(mysample);
}
if (mysample = 0) {
alert("GET OFF MY LAWN");
}
</script>
<body>
<marquee id="Marquee1">Hello</marquee>
</body>
</html>