title: Get tagname name value javascript
body: <p>I'm trying to get the tagname of name from the below line of code. I have to get the name from the below tagname using javascript</p>
  
  <pre><code>&lt;preference name="webviewbounce" value="false" /&gt;
  </code></pre>
  
  <p>i need to get <strong>webviewbounce</strong> </p>
  
  <p>This is what i know.</p>
  
  <pre><code>document.getElementsByTagName("preference")
  </code></pre>
  
  <p>But it doesnt give me the <strong>preference name</strong>. What i want is the tagname of name which is <code>webviewbounce</code></p>