Calling javascript functions from drop down

前端 未结 2 1370
甜味超标
甜味超标 2021-01-06 15:59

I have this HTML code at the moment:

Theme
  • Choose theme
2条回答
  •  粉色の甜心
    2021-01-06 16:10

    Demo: http://jsfiddle.net/zYMFa/

    Use values for options and handle change event for select. The value property of select gets value of the selected option, so you can use this.value in change function.

    document.getElementById("myList").onchange = function() { setActiveStyleSheet(this.value); return false };

提交回复
热议问题