<input type="submit" value="1" id="a">
var a = document.getElementById('a'); a.onclick = go; function go() { alert(a.getAttribute('value')); }