I am writing a piece of code which will show button label of all jquery buttons having class="Short"
I am using the following code:-
$('.Short').button();
var all_short_btns = $(".Short");
for(i=0; i< all_short_btns.length; i++){
alert(all_short_btns[i].button( "option", "label" ));
}
Html is:
<button class="Short">Label1</button>
<button class="Short">Label2</button>
<button class="Short">Label3</button>
<button class="Short">Label4</button>
<button class="Short">Label5</button>
<button class="Short">Label6</button>
I am getting error:
Uncaught TypeError: Object # has no method 'button'
My Question is how to get label for each button element ?
Thanks in advance.