()
| 21 | |
| 22 | //for the operation and callback operation |
| 23 | function clickHandler() { |
| 24 | var inputText = txtInput.value; // taking input |
| 25 | |
| 26 | // calling server for processing |
| 27 | fetch(getTranslationURL(inputText)) |
| 28 | .then(response => response.json()) |
| 29 | .then(json => { |
| 30 | var translatedText = json.contents.translated; |
| 31 | outputDiv.innerText = translatedText; // output |
| 32 | }) |
| 33 | .catch(errorHandler) |
| 34 | }; |
| 35 | |
| 36 | btnTranslate.addEventListener("click", clickHandler) |
nothing calls this directly
no test coverage detected