-3

Is it possible in javascript or Jquery to click on an input field in my case:

<input id="search" type="text" placeholder="...">

and push Enter

John Does Legacy
  • 1,441
  • 6
  • 23
  • 33

2 Answers2

0

I think you want to submit the form when the input is clicked so:

var input = document.querySelector('input'),
    form = document.querySelector('form');

input.addEventListener('click', function(){
    form.submit();
});
Gho5t
  • 1,060
  • 1
  • 12
  • 23
0

In terms of a form you can use JQuery post and get methods Example. $(#id).click(function (){ $.post("url", {variable}); });

Re3L
  • 25
  • 4