jQuery Replace with JavaScript functions
<p>I have the following code:</p>

<pre><code>$('input.next_page_img').replaceWith('&lt;input type="submit" class="next_page_image graybutton mediumbutton" alt="Next Page" value="Next Page" title="Next Page" onclick="Add_Search_Param('page', 2); Refine();"&gt;');
</code></pre>

<p>The problem is with the <code>onclick</code> function. It makes the rest of the script fail. When I take out the <code>onclick</code> function, it works. What do I need to do to fix this?</p>

<p>Scratch that, I've ultimately decided this was a bad idea. Instead I'd rather set the attributes of the inputs... why isn't this working though <a href="http://jsfiddle.net/qSBHH/" rel="nofollow">http://jsfiddle.net/qSBHH/</a> ?</p>
