I have input-box. I\'m looking for a way to fire-up alert() if first character of given string is equal to \'/\'...
alert()
var scream = $( \'#screameri
Try this out:
$( '#screameria input' ).keyup(function(){ //when a user types in input box var scream = this.value; if ( scream.charAt( 0 ) == '/' ) { alert( 'Boom!' ); } })
Fiddle: http://jsfiddle.net/maniator/FewgY/