Question: ```
$('#foo').live('keyup', function (e) {
  var input = $(this).val();
  // code to process input
});

```

This is used in a post form and I need to run the code inside the live() when the document is ready. Is there a way, other than to wait for a key press, to invoke it?

Answer: 
```
$(function() { 
   // add the event
  $('#foo').live('keyup', function (e) { 
  var input = $(this).val(); 
      // code to process input 
    }); 
  $('#foo').trigger('keyup');  //trigger the event
}); 

```
If you're asking how to attach the keyup event *after* the document is ready, this is the sollution:

```
jQuery(document).ready(function($) {

    $('#foo').live('keyup', function (e) {
      var input = $(this).val();
      // code to process input
    });

});

```

However, this would have no function, because the whole idea of heaving `jQuery.live` is to automaticly bind to each selector, *now and in the future*.

Also, you're specifing an ID as the selector. The id must be unique to an element. 
Thus being able to bind it to multiple elements with the ID foo would be technically incorrect.