Html5 adds the voice input function to the input box

Source: Internet
Author: User

You can see the microphone icon on the right of the input box and click on the microphone to make speech recognition.

Actually very simple, speech recognition is the basic function of HTML5, its usage is

<input type= "text" Speech X-webkit-speech/>
If you like the syntax of XHTML similar, you can say that

<input type= "text" x-webkit-speech= "X-webkit-speech"/>
Speech recognition was unthinkable a decade ago, and even in previous years, speech recognition on a Web page can only be implemented in other ways, such as using Flashplayer and so on. But now, getting the speech simply adds a property tag to the input box and can be identified.

Mobile devices, such as browsers on a mobile phone, should support speech recognition as long as they support HTML5. Try your Android to browse this page?

Also, if you want to use JavaScript to get speech recognition at the end of this event, you can use the Onwebkitspeechchange

<input type= "text" Speech X-webkit-speech onwebkitspeechchange= "alert (this.value)"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.