jQuery取得select选中的值

原文地址为: jQuery取得select选中的值

记录一下。

本来以为jQuery("#select1").val();是取得选中的值,

那么jQuery("#select1").text();就是取得的文本。

这是不正确的,正确做法是:

jQuery("#select1  option:selected").text();


转载请注明本文地址: jQuery取得select选中的值

猜你喜欢

转载自blog.csdn.net/linjcai/article/details/80846490