How to apply jQuery function .one() to element through attribute 'onclick'
<p>I want to clear an input field when it's clicked, but only the first time you click. With jQuery, you can achieve it like this: putting the following snippet anywhere in the document (assuming the element with id=<code>inputf</code> has already been loaded):</p>

<pre><code>$('#inputf').one("click", function() {
    $(this).val("");
});
</code></pre>

<p>As you can see in the above snippet, the input field must have <code>id</code> attribute with value <code>inputf</code>.<br>
But is there a way to move that snippet to the <code>onclick</code> attribute of the input field, like</p>

<pre><code>&lt;input type="text" onclick="$(this)....val('')" /&gt;
</code></pre>

<p>? It looks like I can't use the function <code>.one()</code>, because that function needs a string containing one or more JavaScript event types. But I just want <code>.one()</code> to be executed each time it is called, without specifying one or more event types.</p>
