I am trying this:
Try this:
JS Code
function search(ele) { if(event.key === 'Enter') { alert(ele.value); } }
DEMO Link