My own function firing like onclick
<p>I think the title is not very adapted, but I don't know what to put else than that. Edit it if you want.  </p>

<p>What I want is very strange but please don't downvote. I want to create my own function that will be called like that : <code>&lt;input type="text" onMyFunction="alert('hi');" /&gt;</code>  </p>

<p>If it's not possible, just tell it and I check it as the best answer.  </p>

<p>P.S: If it works, the function would be permanently called and inside this function I would put an <code>if</code> at the beginning.</p>
