call javascript function onchange event of dropdown list

后端 未结 5 635
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 19:38

I want to invoke javascript function when value in the dropdown list changes. I dont want to hardcode dropdown list id .

Hence not using document.getElem

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 19:54

    jsFunction is not in good closure. change to:

    jsFunction = function(value)
    {
        alert(value);
    }
    

    and don't use global variables and functions, change it into module

提交回复
热议问题