title: Get text from XPath located Element using Selenium WebDriver with JavaScript
body: <p>I am trying to find an element using xpath and get the elements text value.</p>
  
  <p>For example, I can find the element using xpath in the following way</p>
  
  <pre><code>driver.findElement(webdriver.By.xpath("//div/span));
  </code></pre>
  
  <p>But I want to get the text of this particular element by using JavaScript.</p>
  
  <p>HTML content is like below</p>
  
  <pre><code>&lt;div&gt;&lt;span&gt;Inner Text&lt;/span&gt;&lt;/div&gt;
  </code></pre>