Jquery - changing button to an image

is it possible to replace a jquery button with an image or text. Here’s the code below:


  $(".test .hide").replaceWith( "<a href"#">Test</a>" ).click(function(){

<div class="test">
<button class="hide">Hide</button>

Any help would be great.

The main reason that the snippet you posted is not working is because of the double quotes in this:

"<a href"#">Test</a>"

Change it to use single quotes and add an equals sign:

"<a href='#'>Test</a>"

Does that help?