Skip to content

Instantly share code, notes, and snippets.

@AvgustPol
Created November 22, 2020 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AvgustPol/f4870b68706c1ce7b263f145adecf10c to your computer and use it in GitHub Desktop.
Save AvgustPol/f4870b68706c1ce7b263f145adecf10c to your computer and use it in GitHub Desktop.
input
<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