Ashwini Nayak Ashwini Nayak - 2 months ago 7
jQuery Question

How do I concatenate my element id in this scenario?

How can I get the selected text for a drop down in the below scenario?

var abc = $("#ddlReason"+bidId+"option:selected").html();


As you see above, "bidId" is a variable that I need to suffix with the dropdown id "ddlReason".

Answer
string.Format("#{0}{1} option:selected", ddlReason, bidId);

this will build your string the way you want it.