title: Get text inside an element using javascript
body: <p>I am trying to get a text content inside a div using jquery. But it returns 'undefined'. Please someone tell me what i'm doing wrong here. this is my code.</p>
  
  <pre><code>&lt;a&gt;&lt;div class="exc_text"&gt;Some text here&lt;/div&gt;&lt;/a&gt;
  
  
  $(document).on('click','.exc_text',function(){
      var text = $(this).textContent;
      console.log(text);
  });
  </code></pre>