function confirmSomething()
{
if (confirm("Are you sure you want to do Something?"))
{
'something
}
else
{
' not something
}
}
<script language="JavaScript">
function check(){
if(confirm('Are you sure?')){
alert('OK');
} else {
alert('try again');
}
}
</script>
<input type=button onClick="check()">