Unfortunately, this only works in Chrome, but it’s super simple and easy to implement. All you need to do is add an x-webkit-speech attribute to the proper input element.
With JQuery, we can target an input dynamically, and add in the attribute using the attr(); method. Since the attribute doesn’t require a value, we’ll need to pass the webkit speech attribbute, and an empty value to JQuery’s attribute method like so: attr('x-webkit-speech', '');
//add speech input to a text field via JQuery $(document).ready(function(){ $('#search').attr('x-webkit-speech', ''); });
Big thanks to phpied.com for the inspiration.


