JQuery - Add an onmouseover attribute to an input element where type equals image
<p>Is it possible to add an onmouseover attribute to an input element where type equals image?</p>

<p>I have created the following code but it does not add the attribute.</p>

<pre><code>    &lt;script language="javascript" type="text/javascript"&gt;
        $(document).ready(function() {
            $("input").each(function(i) {
                if (this.src.indexOf('/images/icons/thumbs.png') != -1) {
                    $(this).attr({ onmouseover: "images/icons/thumbsover.png" });
                    $(this).attr({ onmouseout: "images/icons/thumbsout.png" });
                }
            });
        });
    &lt;/script&gt;
</code></pre>
