IE: val() is null or not an object - document not ready?

IE: val() is null or not an object - document not ready?


Hi,
I'm quite new to jQuery development and bug reporting/tracking/fixing,
so I hope I'm posting this in the right place.
I added the following script in the head of my page:
$(document).ready(function() {
$('#edit-keys').val($('#edit-keys').val().replace('
type:product,''));
});
It is supposed to strip the string " type:product" from the value of
an input field. It works fine in firefox and IE6, but not in IE8 rc1
(both in IE7 and IE8 mode). The error message was "val() is null or
not an object". I couldn't test on the original IE7. After I moved the
script to the bottom of the page, it worked fine. It seems as if the
script was run before the document was ready.
Is this a bug? Should I submit a bug report?
Marc