I've got input
with text
type. I want to clear it when I click on it.
However my approach does not work
<span class="input"><input type="text" id="input1" onclick="clear()"></span>
Where clear()
function is
function clear() {
alert(event.target.id);
event.target.value = "";
}
What is the correct way?