last day (15 days later) » 

07:04
0
A: How get html select > option tag custom attribute value using jquery?

osman RahimiYou should call data() instead attr(), rewrite you code like this : function setattr(brnditem) { var test = $(brnditem).find("option:selected").data('um'); console.log(test); }

i think there's something wrong with my code. I tried your code but still undefined. please see updated question.
I think you shoudl use brnditem in setattr() instead of this
$(brnditem).find('.pitemname').data('um'); still undefined.
how do you call setattr() and what do you pass as a parameter?
onchange='setattr(this)' i have included this in my question.
07:04
so I think we don't need find(), I've updated answer
let me copy your code into an online editor and test it
Im using laravel. anyways, my table is populated from the database and every select options inside the <td> as well. still undefined. :( or maybe ill try a different approach.
please see the updated DOM result in my question.
See this link jsfiddle.net/db2mwohe
@jzoler see my answer update
@jzoler have you seen the link above?
yes but it returns an error.
now it must work. tehrer was ` find` missing
still undefined.
07:05
see this link
it works fine I don't know why you say it returns error
Have you checked it?
Are you tehre?

last day (15 days later) »