Get value attribute for <a> with this.getAttribute('value') - Javascript DOM

Javascript examples for DOM:Element getAttribute

Description

Get value attribute for <a> with this.getAttribute('value')

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> //from w w w. ja v a 2  s. c  om
 <body> 
  <a href="#" value="IE" onclick="console.log(this.getAttribute('value'))">Click</a>  
 </body>
</html>

Related Tutorials