Changed the code to below and it worked
<Script language=JavaScript>
function openDialog(){
// Prompt user where to save, or use a input type of file
document.execCommand("Print",true,null);
}
</Script>
<input type="button" id="htmlBtn" value="Save as an HTML document"
onClick="openDialog()">