The first thing is you define a global variable that checks whether the click has occured
let isFirstClick = true
Then you create handler, that checks if no clicks have occured then find input by id and clear it's value.
const modifyText = () => {
if (isFirstClick) {
const ds = document.getElementById("ds")
ds.value = ""
isFirstClick = false
}
}
Then attach click to the document
document.addEventListener("click", modifyText)
When your script is exiting destroyed don't forget to remove the listener
document.removeEventListener("click", modifyText)