Top-tompak,
и что не так работает?
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<div class="wrap">
<div class="question">акдбука</div>
<div class="question">акажср</div>
<div class="question">аксмронббложбжж</div>
</div>
<input type="text" name="question" placeholder="Вопрос">
<script>
$(function() {
$('input[name=question]').keyup(function() {
//console.log('keyup()');
var question = $('input[name=question]').val();
//console.log('question - ' + question);
$('.question').each(function(k, v) {
//console.log('value - ' + $(this).text().toString());
var val = question + '[^а]*$';
var re = new RegExp(val, 'i');
if (re.test($(this).text()) && question) {
alert('This ok - ' + $(this).text().match(re));
};
});
});
});
</script>
</body>
</html>