I have a div ID that triggers some javascript. It works fine outside of the innerHTML, but when I try to only have it trigger when the div ID is clicked (while in the innerHTML) it does not trigger.
The code:
<script type="text/javascript">
function ChangeStyle()
{
document.getElementById("p1").innerHTML =
"<div id='12345' class='button next' class='move next'><a href=\"javascript:void()\">CONFIRM </a></div>";
}
</script>
<span id="p1">
<div class="button"><a href="javascript:void()" onclick="ChangeStyle();alert('hello');">CONFIRM </a></div></a>
</span>