Q:

How to allow only a particular word in the textbox using jquery? 

My requirement is I have to allow the user to enter only '@' keyword.  if the user enter the other keyword it should not display anything in the textbox.  
<input type="text" />
document.getElementById('txtSearch').onkeypress = function (e) {
    if (e.keyCode === 64 ) {
        alert('welcome');
        return false;
    }
};

A:

You can restrict any word using the following code. 
$("#IDofTextInput").on("keyup", function(){
    if(!("@".startsWith($("#IDofTextInput").val())))
  {
    $("#IDofTextInput").val($("#IDofTextInput").val().substring(0, $("#IDofTextInput").val().length-1));
  }
});

