Confirm Dialog box in Visualforce page

Visualforce Page:

<apex:page>
    <apex:form>
        <apex:pageblock>
            <apex:pageblocksection title="Confirm dialog box Demo" collapsible="false">
                 <apex:commandbutton value="Click to Confirm" onclick="return confirm('Do you want to submit');"></apex:commandbutton>
            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

download