Get selected option from select element

后端 未结 12 978
温柔的废话
温柔的废话 2020-12-08 01:45

I am trying to get the selected option from a dropdown and populate another item with that text, as follows. IE is barking up a storm and it doesn\'t work in Firefox:

<
12条回答
  •  一个人的身影
    2020-12-08 02:21

    Here is a shorter version that should also work:

     $('#ddlCodes').change(function() {
          $('#txtEntry2').text(this.val());
        });
    

提交回复
热议问题