I am trying to replace the content of a DIV once the button inside that DIV is clicked, (basically replacing the button, which retreives a PHP variable:
<div id="buttonholder">
<a href="#" onClick="return false" onmousedown="javascript:publish('<?php echo $id;?>');">Publish</a>
</div>
I am trying to replace it with an unpublish button after a post is published (when the button above is clicked):
function publish(status){
document.getElementById("buttonholder").innerHTML = '<a href="#" onClick="return false" onmousedown="javascript:publish('<?php echo $id;?>');">Unpublish</a>';
}
It does not work however ... What am I doing wrong ?