Reputation: 1944
I'd like to pull an attribute value from the input
This is some of my html:
<input type="checkbox" name="invoice" client="14" value="53">
<input type="checkbox" name="invoice" client="14" value="54">
<input type="checkbox" name="invoice" client="17" value="52">
But I can't seem to be able to select anything, everytime I try to use a function while I'm eaching through them, is throwing undefined function
var inputs = $('input[name=invoice]');
inputs.each(function(){
console.log(this.attr('client'));
});
Uncaught TypeError: undefined is not a function
while if I say this.value
it returns 53, 54 and 52
Upvotes: 0
Views: 46