First you need to add Jquery library to work and then you have to use preventDefault() like below:-
<form id="my_form" action="process.php" method="POST">
<input type="submit" id="subm" class=" submit_button" value="Submit" >
</form>
<script src = "https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type = "text/javascript">
$(document).ready(function(){ // After document is completly loaded
$("#subm").click(function(e) {
e.preventDefault(); // prevent the form submit on click
alert('Does work'); //alert the message
});// you missed ); here
});
</script>
Note:- check your browser development console and you will exactly get what errors are there.
$(document).ready(function(){ // After document is completly loaded
$("#subm").click(function(e) {
e.preventDefault(); // prevent the form submit on click
alert('Does work'); //alert the message
});// you missed ); here
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="my_form" action="process.php" method="POST">
<input type="submit" id="subm" class=" submit_button" value="Submit" >
</form>
php. Please fix your questions tags...