The stop web page to sotp an occuring action

This is the web page sent by the python server when an action is launched by the user to stop it(this action). Unfortunaly, HTML doesn't provide method like onMouseDown or onMouseUp ti fire a request sending to the server from a  webpage. Only Click method is available for submit buttons,otherwise we can use javascript to send continuous request while an action is launched by the user, but how to know when he abandon the button to stop the action and send then a STOP command to the server? It's to solve this problem that we thought about another webpage named stop.html(in fact this file) wich is sent to the user each time he launches an action. For example, when i click on the "FORWAD" button on the main app webpage, a request is sent to the server and it activate desired motors, and return back to the user this stop.html page to allow him to stop the action. So more than one action can be make at the same time. This assume  certain security for the robot since the user knows precisely what he is doing and can't make opposite actions such as moving forwad and backword simultaniously.