I have the following simple Jquery:
<script type="text/javascript">
$(document).ready(function(){
$(document).one('focus', 'input', function() {
$(this).val('');
});
});
</script>
<input type="text" value="Default 1" />
<input type="text" value="Default 2" />
<input type="text" value="Default 3" />
<input type="text" value="Default 4" />
<input type="text" value="Default 5" />
The above code will lead to running the focus function only once for all elements.
How to make it run the function once per each input element? Example:
Click the second element, run once. Click the first element, run once. And so on...