Html5 adds the voice input function to the input box. The html5 input box

Source: Internet
Author: User

Html5 adds the voice input function to the input box. The html5 input box

Here we will introduce the powerful html functions that you will use in the future. You can directly add the voice function to the input box. Let's take a look at the implementation method.

You can see the microphone icon on the right of the input box. Click the microphone to perform speech recognition.

In fact, it is 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 similar to XHTML, you can

<Input type = "text" x-webkit-speech = "x-webkit-speech"/>

Speech recognition was incredible ten years ago. Even a few years ago, speech recognition on Web pages could only be implemented in other ways, such as Flashplayer. However, to obtain a speech, you only need to add an attribute label to the input box to identify it.

Mobile devices, such as browsers on mobile phones, should also support speech recognition as long as html5 is supported. How can I view this webpage on Android?

In addition, if you want to use javascript to obtain the end of the speech recognition event, you can use onwebkitspeechchange

<Input type = "text" speech x-webkit-speech onwebkitspeechchange = "alert (this. value)"/>

Address: http://www.php100.com/html/program/html5/2013/0905/5423.html

Related Article

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.