I tested it, it works, but your sample is has a bug and is incomplete. Compare:
<html><body>
<div id="modelTest">Some div to click on...</div>
<script>
document.getElementById("modelTest").addEventListener("click", function() {
alert("clicked");
});</script>
</body></html>
Note: "click", not "onclick".
—SA