Busca en cnbGuatemala con Google
18 bytes eliminados
, hace 8 años
Línea 94: |
Línea 94: |
| $('#searchInput').val('Comunicación'); | | $('#searchInput').val('Comunicación'); |
| var pressEvent = document.createEvent('KeyboardEvent'); | | var pressEvent = document.createEvent('KeyboardEvent'); |
− | pressEvent.initKeyEvent("keypress", true, true, window, false, false, false, false, 0, char.charCodeAt('n')); | + | pressEvent.initKeyEvent("keypress", true, true, window, false, false, false, false, 0, 40); |
| var input = document.getElementById('searchInput'); // Get the element where you want to press. | | var input = document.getElementById('searchInput'); // Get the element where you want to press. |
| input.dispatchEvent(pressEvent); // Press the key. | | input.dispatchEvent(pressEvent); // Press the key. |