Pergunta

In chrome and in some add-on, Auto added x-webkit-speech ´s attribute in <input>

Example :

<input type="number" x-webkit-speech>

I found this from Chrome Developer Tools (Inspect Element).

How can I remove x-webkit-speech by jQuery ? or disable by HTML ?

I do like

$('input').removeAttr('x-webkit-speech');

This dosen't work :(

Foi útil?

Solução 2

Found Howto now :

Just add some delay like

setTimeout(function(){
   $('input').removeAttr('x-webkit-speech');
},1000);

Because that some add-on added x-webkit-speech´s attr after page loaded.

Outras dicas

The correct way to do this would be:

function main(){
    $('input').removeAttr('x-webkit-speech');
}

And in your HTML set the onload to main:

<body onload="main();">

Doing it as l2aelba said wouldn't necessarily work all the time as sometimes the page loads slower than in one second. Additionaly, sometimes the page will load faster and the user may notice it.

With the above example, it will happen as soon as the page loads, which is the professional, efficient, and ideal way to do it.

Good luck!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top