Need the following code to work and make a confirmation alert appear after clicking on a button.
It's kinda of a "exit website button".
Confirmation appears: Clicks "OK" > current window close; Clicks "Cancel" > confirmation alert close;
HTML
<a href="#"><i class="fa fa-power-off" onclick="closeWebsite()"></i></a></div>
Javascript
<script>
function closeWebsite(){
window.close();
}
</script>
Where's my mistake? I'm currently learning Javascript.