How do I dynamically set the selected option of a drop-down list using jQuery, JavaScript and HTML?

前端 未结 7 1220
我在风中等你
我在风中等你 2021-02-04 09:17

For some reason, I can\'t get this to work.

My options list is populated dynamically using these scripts:

function addOption(selectId, value, text, sele         


        
7条回答
  •  长情又很酷
    2021-02-04 09:52

    Pardon my ignorance, but why are you using $('.salesperson') instead of $('#salesperson') when dealing with an ID?

提交回复
热议问题