I am using the following code and it sets the value of the 2nd line correctly. When I use the debugger I can see that typeSelected HAS a text value I expect:
var typeSelected = $("#dialogType :selected").text();
parent.find(".refType").html('aa');
When I replace it with:
var typeSelected = $("#dialogType :selected").text();
parent.find(".refType").html(typeSelected);
Then the 2nd line doesn’t get set to anything.
Is it wrong just for me to put .html(typeSelected) ?
What kind of element is
"#dialogType"?Looking at
":selected"I think you should use.val()instead of.text()to get the correct value.