I want to slideDown div on keyup. But When I use $(this)
selection in the post or get method it does not work. Outside it does. But inside post it does not work.
This is my code.
$('.search').keyup(function() {
var ID = $(this).parent().find('.hiddenid').val();
var Search = $(this).val();
if (Search == "") {
$(this).parent().next().slideUp('fast');
} else {
$.get('getphone.php', {
ID: ID,
Search: Search
}, function(D) {
$(this).parent().next().html(D).slideDown(1000);
});
}
});
In this code, I'm trying to get the next of the parent of the class 'search' to slide it Down.but once i use $(this)
it does not work.