Q:

JQuery :not:has gives Type Error

I have a problem with a jQuery selector.
$('#test').keyup(function(){
    var val = $('#test').val();
    $('p').hide();
    $("p:has(b):contains(" + val + ")").show().next().show();
    $("p:not:has(p):contains(" + val + ")").show();    
});

$("p:not:has(p)").show(); select the given types, 
but 
$("p:not:has(p):contains(" + val + ")").show();

gives the type error.
$("p").not(":has(p):contains(" + val + ")").show();

gives an error too. How can I use :contains()?
Edit:
There is the fiddle https://jsfiddle.net/ev1v0cwa/
The p:not:has(p):contains gives in Firefox a TypeError: a is undefined
and in Fiddle the Error selector undefined??

A:

Try $("p:not(:has(b)):contains(" + val + ")").show().prev().show();
See this fiddle

