I have a function that is to be executed on click of a button. It is not working when I click the button. All of my other functions work when I click the button.
Javascript:
window.onload = function() {
var button = document.getElementById("test");
test.onclick = function() {
var summonerid = document.getElementById("username").value.length;
function summonerName() {
if(summonerid = 4){
alert("Come on");
}
else {
alert("wai");
}
}
}
}
Html:
<input type="text" name="summoner" id="username" maxlength="16" autocomplete="off" style="font-size: 22pt; font-family: times new roman">
<input type="submit" id="test" style="font-size: 22pt; font-family: times new roman">