0

sort of confusing to explain but I have a 'select' dropdown that doesn't exist on page load, and I need to take the selected text value of it when it does exist, and display it into a div on the page. My jquery is as follows:`

var conceptName = $('select[name="ShippingSpeedChoice"]').find(":selected").text();
$('select[name="ShippingSpeedChoice"]').on("change", "paste", function(){$('.valss').html('+conceptName+');
});  

`Any ideas what I'm doing wrong? Thanks for the help!

4

1 回答 1

3

这就是你所追求的吗?(我从您的描述中猜到了您的 HTML 结构)

http://jsfiddle.net/zxGae/

我已经模拟了动态添加<select>并重新排列你的.on,因为我不知道paste是为了什么:

$(document).on("change", 'select[name="ShippingSpeedChoice"]', function (e) { ... });
于 2013-05-27T04:32:34.953 回答