title: fetching id or class name of an unordered list
body: <p>My Jquery console returns the below value. As you could see both <code>$prnt</code> &amp; <code>$parent</code> return same value when compared but the if statement return false </p>
  
  <pre><code> console.log($prnt)
   //ul#testin.hidden-links
  
   console.log($parent)
   //ul#testin.hidden-links
  </code></pre>
  
  <p>How could I access the id or class name for comparison purpose or how cd I get the below <code>if</code> statement to return value as <code>True</code>. Below is the Jquery code.</p>
  
  <p><strong><em>Jquery</em></strong></p>
  
  <pre><code>    $(document).ready(function(){      
             $("#cbp-hrmenu &gt; ul &gt; li &gt; a").on('click', function(event){
                $item = $(event.currentTarget).parent('li');
                   var $parent = ($item).parent('ul').get();
                    var $prnt = $('#cbp-hrmenu &gt; ul').get();
  
                      //Below if statement doesn't work only return console 
                       //value within else statement even if if is true
  
                             if( $parent === $prnt){ 
                               console.log($item.index());
                                 console.log("True");
                           } else {
                       console.log("false");
                    console.log($parent);
                console.log($prnt);
              }
  
            });
       });
  </code></pre>