This code works what happens with this problem is easy, it is not a compatibility problem what happens is that when the script is executed the DOM tree has not yet been loaded, it happens like this:
You open the page.
The HTML is loaded, the head is read, the goals and other labels are read, the famous script is reached, the script says that there is a (something, it can be an input or a simple div, whatever it is). ..) with an identifier ('#txtConvBusFch') and associated with an event ('keypress') I will immediately look for it in the body but see that the body (body) of the html has not yet been loaded, which means that an error, the input tag does not exist.
The browser's javascript interpreter keeps reading that this event will search to know if the pressed key is the 'Enter' key (key 13) and will launch in case the event is the expected one 'alert' with a message, end of the script.
Now we start making the DOM tree, all the divs, paragraphs, images and INPUT's elements are created ...
Now there is the input you are talking about and that is when the script could affect the input. How is it done? There are several ways.
Mainly the problem is that the DOM is not loaded before the script, this is solved for example:
1-. Put the script tag not in the header but at the end of the body, before you had it written like this (roughly):
<html>
<head>
<script></script>
</head>
<body>
<input/>
</body>
</html>
Ahora ponlo así:
<html>
<head>
</head>
<body>
<input/>
<script></script>
</body>
</html>
You'll see that it works perfectly.
2-. I see that you use jQuery, to make the script always run when the document is ready you just have to wrap it with this and you can leave it in the header and it will work fine too.
<script>
$(function(){
//Aquí va tu código.
})
</script>
3-. You can put your code without jQuery in the header inside this that what it will do is execute the code inside it when the DOM is loaded.
window.onload = function ()
{
//Aquí va tu código.
}