开发者

Jquery selected values

开发者 https://www.devze.com 2023-03-13 04:53 出处:网络
$(document).ready(function () { //Store the sub types StoreSubTypes(); 开发者_高级运维//Set up company Type on Change
   $(document).ready(function () {  
                  //Store the sub types      
                     StoreSubTypes();
          开发者_高级运维           //Set up company Type on Change  
                     $("#option").change(CompanyTypeOnChange);
                     $(".status").change(InsuranceTypeChange);
                     CompanyTypeOnChange(); 

                         } );  


Your options are missing a value.

For example change <option>Car Loan</option> to <option value="Car Loan">Car Loan</option>


value is an attribute of the option tag(<option value="">), and this,rather than the textnode value which in the option tag, will be received when form post.

if you just want to get the textnode value,then use some option.innerHTML,or $(option).text().

0

精彩评论

暂无评论...
验证码 换一张
取 消