Skip to content

Commit

Permalink
Updated script
Browse files Browse the repository at this point in the history
  • Loading branch information
Prasanta-Hembram committed May 28, 2023
1 parent 8071703 commit 89a7294
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Mymemory/mymemory.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ <h1>Send Translation to MyMemory</h1>
</script>

<script>

function transferText(){
const textToTranslate = document.getElementById("text-to-translate").value;
document.getElementById("text").value = textToTranslate;
Expand All @@ -98,7 +99,7 @@ <h1>Send Translation to MyMemory</h1>

function func2() {
transferText();
transferText2();
transferText2()
}

</script>
Expand All @@ -119,6 +120,22 @@ <h1>Send Translation to MyMemory</h1>
});
</script>

<script>
// Automatic Translate the text while typing with delay.

const inText = document.getElementById('text-to-translate')
const delay = 2000

let timer
inText.addEventListener('input', code => {
clearTimeout(timer);
timer = setTimeout(x => {
translateText(); func2()
}, delay, code)
})


</script>


</body>
Expand Down

0 comments on commit 89a7294

Please sign in to comment.