Q:

How to activate function during input text change?

I want the function 'name' to be activated and press the submit, while the input text changes.
How can i do it?
<form id="a"> 
  <input type="text" id="client_area" name="client_area" id="email" maxlength="5" size="5" onchange="name();">
  <input id="submit2" name="submit2" type="submit" class="btn btn-primary" value="Start"/>
</form>

<script>
  function name(){
    $("#submit2").click()
  });
);
</script>

*Also, can i add keyup too?
onchange="name();" onkeyup="name();"

Will it work?

A:

name is a reserved keyword to get the name of the function so you will get an error with name is not a function so you need to change the name of your function with Name or some other name:

function Name(){
  $("#submit2").click();
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="a"> 
<input type="text" id="client_area" name="client_area" id="email" maxlength="5" size="5" onkeyup="Name()">
<input id="submit2" name="submit2" type="submit" class="btn btn-primary" value="Start"/>
</form>

This is how name is reserved as:

var fn = function(){
  //some code
};

console.log(fn.name);

