JSFiddle - React, Tailwind, and code Playground

by Michael Milewski

HTML

<form class='search-form-cont'>
<input type="text" class="loc-search">
<div type="text" class="pac-item">drop down text 1</div>
<div type="text" class="pac-item">drop down text 2</div>
<div type="text" class="pac-item">drop down text 3</div>
<input type="submit" class="gig-s-button">
</form>

JavaScript

$('.loc-search').keypress(function(e) {
	var key = e.which;
  if(key == 13) { // the enter key code
    console.log('caught the return');
    //$(".gig-s-btn").click()
  }
});

$('.pac-item').mousedown(function(e) {
  $('.pac-item').closest('form').submit();
});