I believe your best option at the moment is to communicate from your HTML application via an xhr or websockets to a backend system running on your server that can do the actual translation into midi events. You might find that one of the many comet servers that are already available can make this part of your life easier, however many midi applications require relatively low latency, and you'll struggle to get comet techniques down much below 100ms.