I want if values into input was equal with one of the words ed Or d Or i Or ei done perform the operation it. i can not change value input value="ed" in first run page. what do i do?
Example: http://jsfiddle.net/ZsYdY/3/
<input type="text" value="ed">
<div class="code"></div>
function ticket_check() {
//var val = 'ticket_code=' + $('.ticket_code').val();
var input_val = $('input').val();
if (input_val == 'ed Or d Or i Or ei') {
$('.code').empty().hide().fadeIn('slow').append('It is ok');
} else {
$('.code').fadeOut('slow', function () {
$(this).hide().fadeIn('slow').append('It is not ok');
})
}
}
$('.input').live('keyup change', function () {
ticket_check();
var input_val = $('input').val();
if (input_val == 'ed Or d Or i Or ei') {
$('.code').fadeOut('slow', function () {
$(this).hide().fadeIn('slow').append('It is not oooooooookkkkkkkkk');
})
}
});
ticket_check()
needs to be:
And
$('.input')should be$('input')in your exampleUpdated Example