If you want to use a javascript within a custom module, you need to look at this documentation. You will more than likely not be able to reliably call javascript from a module that you've included using an html module. It might work but I doubt it and it isn't the best way to go about including javascript in your module.
If you just want to use a piece of javascript that you have placed within an html module, just call it like you would any other javascript.
<script type="text/javascript">
function displaymessage()
{
alert("Hello World!");
}
displaymessage();
</script>
HTH,
Joe D.