var a = 'button' + 'Save'; document.getElementById(a).onclick = Save; function Save (event){alert ('Save');}