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

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct