<div id="id1" onclick="Function1()">Click on me</div>
<script>
"use strict"
var id1 = document.getElementById("id1");
id1.outerHTML = id1.outerHTML.replace('onclick="Function1()"', 'onclick="Function2()"');
alert(id1==document.getElementById("id1"));
</script>