I’m having a little issue, for styling purposes I’m using a Definition list instead of a combobox, inside my dd tag, there’s an ul, inside every li, there’s a span, with a value attribute. I’m trying to put that value on a text field, so I can use it in a post action. This code is inside the click function of my li:
var temp = $(this).find("span").attr("value");
$("#ch").val(temp);
I believe my selection is right, because when I log temp’s value, it is the one I want, but when I log the ch field’s value, I get undefined.
What am I missing?
Thanks in advance.
José.
However if you’re sure
temphas the correct value (even when using the wrong method), then you’re probably not hitting your target, are you sure the element has the IDch?