title: Chrome extension to detect locale of current tab
body: <p>I want to show the locale(lang attribute of html source code) of the tab selected and display it in my popup.html of Chrome-Extension. For doing this. My popup.html is:</p>
  
  <pre><code>&lt;div id="pageLocale"&gt;Page Locale is: &lt;b&gt;  &lt;script src="write.js"&gt;&lt;/script&gt;&lt;/b&gt;&lt;/div&gt;
  </code></pre>
  
  <p>My write.js is: </p>
  
  <pre><code>chrome.tabs.executeScript(null,{code:"document.write(document.documentElement.lang)"});
  </code></pre>
  
  <p>If I use this, I get the content of my selected tab all blank and only the locale string. I understand what is the issue here.
  I want to know, how I can extract lang attribute using  "document.documentElement.lang" for the current tab and return it to my popup.html. The current tab selected should not go blank when I click chrome-extension icon. Please help guys.</p>