我遇到一个问题,当选择下拉列表时,我正在调用一个函数来显示文本。
问题在于,无论选择哪个下拉列表,它都只会显示第一个选项中的文本。
当我查看实际代码时,我看到我在调用函数jumpto并获取其中的变量。 x-y-z
。一切看起来都是正确的,但是它只会拉出我为新用户提供的文本,而不是新用户的文本。有什么帮助吗?
document > form2 > of the menu> option and its index # > and the value of that option
答案 0 :(得分:0)
将if(document.form2.jumpmenu.value = "New User")
中的单等号替换为if(document.form2.jumpmenu.value === "New User")
之类的三等号。单一等于将只分配值,但在这里您还需要检查else if
的值Same的真实性