Created
November 22, 2020 20:23
-
-
Save AvgustPol/f4870b68706c1ce7b263f145adecf10c to your computer and use it in GitHub Desktop.
input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> | |
function isWordCorrect(word, correctWord ) { | |
word = word.toLowerCase(); | |
word = word.trim(); | |
return word === correctWord; | |
} | |
function onsubmitLogic(){ | |
var correctWord = "di"; | |
var input = document.getElementById("wordInput"); | |
var result = isWordCorrect(input.value, correctWord); | |
console.log(input.value); | |
console.log(result); | |
document.getElementById("rec253104706").innerHTML = input.value; | |
input.value = ''; | |
return false; | |
} | |
</script> | |
<div id="rec253104706"> | |
FOOO | |
</div> | |
<form action="#" onsubmit="onsubmitLogic()" id="myform"> | |
Word: <input type="text" id="wordInput"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment