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…