¡@

Home 

2014/10/16 ¤W¤È 12:02:16

jquery Programming Glossary: buttonvalue

$(this) OR event.target OR var input = $(this)

http://stackoverflow.com/questions/3388019/this-or-event-target-or-var-input-this

again from scratch to find what it's already found once '#a_button' .click function I KNOW THAT THIS IS NAUGHTY var buttonValue '#a_button' .val '#a_button' .addClass 'button_has_been_clicked' Currently I'm using either of the following but am not.. of the following but am not entirely sure what each is actually doing '#a_button' .click function USING this var buttonValue this .val this .addClass 'button_has_been_clicked' But is this just re selecting like in the first naughty example '#a_button'.. is this just re selecting like in the first naughty example '#a_button' .click function event USING event.target var buttonValue event.target .val event.target .addClass 'button_has_been_clicked' This seems like it might be better but is it efficient..

Retrieve Button value with jQuery

http://stackoverflow.com/questions/487056/retrieve-button-value-with-jquery

.ready function '.my_button' .click function alert this .val script button class my_button name buttonName value buttonValue Button Label button In Firefox my alert displays 'buttonValue' which is great but in IE7 it displays 'Button Label'. What.. script button class my_button name buttonName value buttonValue Button Label button In Firefox my alert displays 'buttonValue' which is great but in IE7 it displays 'Button Label'. What jQuery should I use to always get the button's value Or should.. using a different approach Many thanks. ANSWER I'm now using input class my_button type image src whatever.png value buttonValue jquery share improve this question As a button value is an attribute you need to use the .attr method in jquery. This..