in pure javascript you can do something like:
function changeToImage(el) { var img = document.createElement('img'); img.setAttribute('src', 'http://www.google.com/images/nav_logo29.png'); img.setAttribute('ID', el.getAttribute('id')); var parent = el.parentNode; parent.appendChild(img); parent.removeChild(el); }
then from your html you would do
<input type="checkbox" onclick="changeToImage(this)" />
note that this may not be cross-browser proof .... you can also use jquery to simplify things
source share