Confirm Or Cancel Pop Up Box

The code to do a confirm box

<script>
function code()
{
if(!confirm("Do you want to hear some music?"))
history.go(-1); return""
}
document.writeln(code())
</script>