Issue with .change function in jQuery form

前端 未结 4 564
囚心锁ツ
囚心锁ツ 2021-01-24 15:57

I am working on a script that changes the span text value depending on user input in the select menu.

I have a fault with my current script. How do I fix it so when I cl

4条回答
  •  一个人的身影
    2021-01-24 16:43

    This will do

    $(function() {
      $('#usertype').change(function() {
         $(this).next("span").text($('#usertype option:selected').text());
      });
    });
    
    
    Start Date

提交回复
热议问题