bootstrap select option display value instead of text

前端 未结 2 1734
说谎
说谎 2021-01-24 02:53

this might have been answered already, but I don\'t think this particular question has been answered.

I have a dropbox (select & option) and I want to display the va

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-24 03:20

    With Jquery code, try this one:

    $('#inputmsgType').click(function() {
                $('#description').html("Option value is:" + $('#inputmsgType').val() +
                        "
    Option Description is: " + $('#inputmsgType option:selected').text()); });

提交回复
热议问题