if is true javascrtiptr
var booleanValue = true;
function someFunction(){
if(booleanValue === true){
return "something";
}
}
if is true javascrtiptr
var booleanValue = true;
function someFunction(){
if(booleanValue === true){
return "something";
}
}
using if else how to compare value in js
<!doctype html>
<html>
<head>
<script type="text/javascript">
/*<![CDATA [*/
function myFunction() {
var answer = document.getElementById('answer');
if (answer == 10)
document.getElementById("valid").innerHTML = "Correct!";
else
document.getElementById("valid").innerHTML = "Please, Try Again!";
}
/* ]]> */
</script>
</head>
<body>
<h2>What is 3+7=?</h2>
<form>
<input type="text" id="answer">
<input type="submit" onClick="myFunction(); return false;">
</form>
<div id="valid"></div>
</body>
</html>
Run code snippetHide results
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us