Sign in
Log inSign up

If statement in javascript

Default profile photo
Anonymous
·Mar 3, 2018

var a = document.getElementById("one"); var b = document.getElementById("two");

b.addEventListener('click',gg);

function gg(){

if(a.value>12){


    alert(great);

}
else{


    ff();
}

}

function ff(){

alert(" there is some problem");

}

// html code

<input type="number" id="one">

<input type="submit" id="two">

Here I am simply comparing the value enter by the user in input field but after hitting submit button nothing happens