Jquery live typing

I have this code:

<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {

    $('div[contenteditable]').focus();
    $('div[contenteditable]').keypress(function (e) {
	
    if(e.which == 13)
	
    {
       document.location='http://www.' + $('div[contenteditable]').html() + '.com';
    } 
    });

});
</script>
<style>
div[contenteditable] { background:white; font-size:42px; color:black;outline:none; border:none; }
</style>
</head>
<body>
<div contenteditable></div>
</body>
</html> 

and I want to add several conditions like : only two words to be accepted, for example google and yahoo also if is nothing typed in and the return(enter) is pressed to appear a alert or something like this…
Thanks…

If you wish to allow only two words to be ‘entered’ in the field, simply make it a DROPDOWN with those two choices.

This is the problem, I don’t want to make a dropdown, I want to make conditions, for example when a user type everything else than google or yahoo to appear an alert