using .change() with a text input

using .change() with a text input

Can I do this? Apparently not the way I have it  since i can't seem to get it to work. But can I use .change() with a text input?

  1. $('#query-list').change(function(){ $('#query-list').attr('title','"' + $('#query-list').val() + '"'); });

I am trying to set a tooltip up on this textbox and I want it to display whatever is currently in the textbox so when there is too much text in the text box to handle the user can hover and, voila!  Also can I initialize .tooltip inside this function.  I only it want to see it when there is something there.


Thanks for any help.