On click get button Value

Try this.

<input type="button" value="Generate" onclick='f1(this)' />

Now alert like

function f1(objButton){  
    alert(objButton.value);
}

P.S: val() is actually a jQuery implementation of value

Leave a Comment