I facing problem with my jquery, on showing input text based on input value. Here is the JS fiddle demo :
http://jsfiddle.net/Ltapp/364/
When I try to input @hot
As many has said, you are binding the event on all the inputs I did a little change:
$(function(){
var myString = /@hotmail/ig;
$("#check").bind('keyup checkvalue', function() {
$('#hotm')[myString.test(this.value) ? 'show' : 'hide']();
}).trigger('checkvalue');
});
using regex if you are using @HoTmAil
it will also hit on that, and also added a custom event checkvalue
to see if #hotm
should be visible on for example a postback on the form you might be using.
demo: http://jsfiddle.net/voigtan/xjwvT/1/