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