A method of implementing speech search box with HTML5

Source: Internet
Author: User
Tags builtin

Let's look at their different displays first.

Here's a screenshot of Firefox:

Here's a screenshot of the Chrome:

The guess is that the code written is definitely incompatible. But you'll find it really easy, even if you're a front-end beginner, you'll understand.

Copy Code

The code is as follows:

  

The meaning of the parameters:

X-webkit-speech: is to let your input box on the right side of a small microphone, with voice function.

Lang: is the language type of the speech that is forced into the input box, for example, the lang= "ZH-CN" is written in Simplified Chinese.

X-webkit-grammar: Refers to the speech input syntax, the "Builtin:search" value makes the content of the speech input as close as possible to the search content, remove the extra characters.

Note: However, this hardware compatibility is still to be improved, because when you are mixed with voice in English, it is estimated that the situation is full.

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.