I have a page with just a searchbox on provided by google
<gcse:search></gcse:search>
Now when I type in the search box and hit enter I would like to trigger my script to run as the search results gets returned.
Things I have tried sofar
Here I tried to use the submit event to trigger my script
$(document).on('submit', 'input', function(e) {
alert('trig');
}
Here I tried to catch the enter key as I have removed the search button
$(document).keypress(function(e) {
alert('triggered');
});
Here I tried to catch the focus on the form id
$('#gsc-i-id1').focus().trigger(function(e) {
alert('triggered');
});
All unsuccessfull
Here is a list of id's and classes the gcse tag creates
#___gcse_0
.gsc-control-cse .gsc-control-cse-en
.gsc-control-wrapper-cse
.gsc-search-box .gsc-search-box-tools
.gsc-search-box
.gsc-input
#gsc-iw-id1
#gs_id50
#gs_tti50
#gsc-i-id1