Set the heading to the updated value of update.  

<html>
<body>
<h1 id="sale">Sale!</h1>
<script src="script.js"></script>
</body>
</html>]]>

Make sure to assemble .getElementById("sale").innerHTML = update;.