Track input field text and run function on the fly?

Track input field text and run function on the fly?

Hi,

How can I track what is written to an input field on the fly(event that is not "click" "hover" etc but something like "track" or "observe")?

Lets say I have a js object like this:
  1. var array1 = {id1: 'keyword', id2: 'execute', id3: 'go'};

And 3 input fields like this:
  1. <input id"id1" name="id1"></input>
    <input id"id2" name="id2"></input>
    <input id"id3" name="id3"></input>


I want to track the input fields so that
  1. if(
    the string "keyword" is written to the id1 field
    the string "execute" is written to the id2 field
    the string "go" is written to the id3 field
    ){ something happens on the fly without any refresh or blur or press of a submit button};








Something like this(does not work...):
  1. //tracks all input fields
    $('input').live("track", function(){


  2. //If the string that is defined in the array is written to the input field

  3. if (this.val == array1[this.id]) {    //Should i use "val" here..?

    //do something:
    thefunctioniwanttorun();

    }
    });










Thanks for all answers!