For Google Chrome 25 and later you can use the JavaScript Web Speech API:
Some interesting points from the documentation:
This specification was published by the Speech API Community Group. It
is not a W3C Standard nor is it on the W3C Standards Track
The Web Speech API aims to enable web developers to provide, in a web
browser, speech-input and text-to-speech output features that are
typically not available when using standard speech-recognition or
screen-reader software. The API itself is agnostic of the underlying
speech recognition and synthesis implementation and can support both
server-based and client-based/embedded recognition and synthesis. The
API is designed to enable both brief (one-shot) speech input and
continuous speech input. Speech recognition results are provided to
the web page as a list of hypotheses, along with other relevant
information for each hypothesis.
I don't know which other browsers implement this API.