Q:

Get the value of a tag with javascript

I would like to get the value of a tag after clicking on it. I just use javascript and no jquery.
Here's my html :
<div class="touche 1">
   <h1>1</h1>
</div>
<div class="touche 2">
   <h1>2</h1>
</div>
<div class="touche 3">
   <h1>3</h1>
</div>

I need the values 1,2,3, etc... into a variable. The div's work like a calculator button !
Thanks !

A:

Here is the code

function getval(thisa)
{
  alert(thisa.innerHTML);
}
<div class="touche 1">
   <h1 onclick="getval(this)">1</h1>
</div>
<div class="touche 2">
   <h1 onclick="getval(this)">2</h1>
</div>
<div class="touche 3">
   <h1 onclick="getval(this)">3</h1>
</div>

