[jQuery] element replace question
I wish to use jQuery to replace a number of checkbox elements with
image tags:
<input type="checkbox" value="25" />
<input type="checkbox" value="42" />
to be replaced with:
<img src="pic.jpg" onClick="foo(25)" />
<img src="pic.jpg" onClick="foo(42)" />
I am successfull in selecting the checkboxes and using replaceWith to
replace them with img elements, but replaceWith returns the checkbox
element which is gone, so I apparently can't use it to add a click()
function to the newly created image element.