Submit click to google chrome input html tag

Google Chrome has very good browser speech recognition control. For example, if I put this html tag:

<input  id="speech" type="text" speech="speech" x-webkit-speech="x-webkit-speech" onspeechchange="processspeech();" onwebkitspeechchange="processspeech();" />  

with it corresponding javascript:

<script type="text/javascript">

        function processspeech() {
            var speechtext = $("#speech").val();
            alert(speechtext);
        }

</script>

then i can use google speech recognition. I am wondering if it is possible to direct a click on this input control to activate it using JavaScript. In other words, I want to start recording a message by pressing a button other than a small microphone. I plan to use the site locally, so maybe I can send the click in another way.

+5
source share
2 answers

I manage to do this with a program called autoit. here are the steps:

1) AutoIt .

2) html:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        function processspeech() {
            var speechtext = document.getElementById("speech").value;                   
            alert(speechtext);          
        }

    </script>
</head>
<body>


    <div id="speechinput"> 
        <input  id="speech" type="text" speech="speech" x-webkit-speech="x-webkit-speech" onspeechchange="processspeech();" onwebkitspeechchange="processspeech();" />          
    </div> 

</body>
</html>

3) html , google chrome

enter image description here

4), autoit, autoit window info

enter image description here

5) Chrome Chrome ( , ).

enter image description here

6) autoit script:

enter image description here

ControlClick Coords, ...

7) autoit , 5:

enter image description here

8) script, {f5}, , ! ajax - ..

+1

<file>, :

  • click . , .
  • ( z-index). , .

, <input type="file" />, , plupload.

+1

All Articles