I used this:
$('#srch').click(function(){
var s='';
s = $('#gt').val();
if (s == '')
{
$("p") .addClass("default");
} else {
$("p:contains('"+ s +"')") .addClass("active");
}
});
Its working but it keep on storing the previous data. I want the previous data to be cleared.