Getting the value and text from a datalist in jquery

后端 未结 2 415
予麋鹿
予麋鹿 2021-01-28 17:41

I am trying to get the value in the #place input and keep it in that input but have the fax number go into the #fax input? Is it possible to get both values and drop them into

2条回答
  •  Happy的楠姐
    2021-01-28 18:20

    try using jquery attr value

         $(document).on('change', '#place', function () {
             $("#fax").val($("#places option[value='" + $("#place").val() + "']").attr("label"));
          });
    
    
        
            
            
            
        
        

提交回复
热议问题