HTML onchange(this.value) [英] HTML onchange (this.value)
本文介绍了HTML onchange(this.value)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们在代码中发现了这一点(我们还没有亲自编写它,而且我们是Programmng的新手),任何人都可以解释this.value的含义以及如何更改它吗?
We found this in our code (we haven't written it by our selfs, and we are new to programmng), can anyone explain what this.value means and how you change it?
<select id="sel_target" onchange="paint(this.value);sendid(value); highlight(value);move_to(value)">
谢谢!
推荐答案
this.value代表所选值.
this.value represents the selected value.
示例:
function getComboA(sel) {
var value = sel.value;
}
<select id="comboA" onchange="getComboA(this)">
<option value="">Select combo</option>
<option value="Value1">Text1</option>
<option value="Value2">Text2</option>
<option value="Value3">Text3</option>
</select>
上面的示例为您提供了选定的值 OnChange 事件.
The above example gets you the selected value OnChange event.
这篇关于HTML onchange(this.value)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文