Sample Visualforce page:
<apex:page >
<script>
function show(){
alert(‘Test’);
}
</script>
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value=”Store” onclick=”show();”/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Output
Cheers!!!