HTML5 Speech Attribute

7 posts Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

HTML5 Speech Attribute
mikethedj4
After watching this video. I thought I'd try the HTML5 speech attribute myself. It's very simple, all you need is the following code.

JavaScript:
Code: Select all
if (document.createElement("input").webkitSpeech === undefined) {
	var ns = document.getElementsByClassName("nosupport");
	for (i = 0, il = ns.length; i < il; i++) ns[i].style.display = "block";
}
HTML:
Code: Select all
<input type="text" x-webkit-speech="x-webkit-speech" />
That's it, that's the speech attribute in HTML5. It only works in Chrome at the moment, however it is something to mess around with, and is pretty fun to use, especially using the built in development tools inside Chrome.

Hope you guys enjoy this, and find it useful. If you don't well at least it's fun to mess with :D
HTML5 Speech Attribute.zip
You do not have the required permissions to view the files attached to this post.
User avatar
Scottie1972
Codenstuff Elite
Codenstuff Elite
Posts: 953
Joined: Thu Jan 14, 2010 5:48 am

Re: HTML5 Speech Attribute
Scottie1972
Very nice piece of info.

But do to ( x-webkit-speech ) i dont think it would work for IE.
Just Chrome, FF2, Safari, Opera. Im not sure I will have to test it out to see.
Image
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Re: HTML5 Speech Attribute
mikethedj4
Unfortunately this is only available in Chrome at the moment.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: HTML5 Speech Attribute
Codex
What is this for ?
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Re: HTML5 Speech Attribute
mikethedj4
It's just to show the new HTML5 Speech Attribute added in Chrome.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: HTML5 Speech Attribute
Codex
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Re: HTML5 Speech Attribute
mikethedj4
There's demos all over the web, this is just a tutorial on how you can use it.

BTW: You don't need the javascript, just...
Code: Select all
<input type="text" x-webkit-speech />
The javascript is only there for support
7 posts Page 1 of 1
Return to “Tutorials”