checking if e.target is a child of a constant element

checking if e.target is a child of a constant element

Hey guys , i am trying to basically write a Jquery programme that tells me when i click on an element weather that element is a child of another element(parent element , and in my programme , the parent element is a constant ). so heres what i got so far . 

HTML code : 

  1. <div>
  2. <p>lalalalalalalalalalal</p>
  3. <span>blaaaaaaaaaaaaaaaaa</span>
  4. </div>
now the Jquery : 

  1. $(document).ready(function(){

  2.      var str_dv = $('#la');
  3.      $('p').on('click' , function(e){
  4.     
  5.      if (!str_dv.has(e.target).length) {
  6.      console.log('has the element');
  7.      }

  8.      });
  9.      });
Nothing happens :( when i clcik on p or span , i never get has the element , whats the problem . 

also is 

if (!str_dv.has(e.target).length)

the same as 

if (str_dv.has(e.target).length > 0) ?? 

when i add the above condition instead i get a console.log when i click on the p but not when i click on the span . why so ? 

I saw this on SO .  SO thread , but i really don't want to use the $.contains function .