Yes , most notably!
(是的 ,最值得注意的是!)
I don't think the second one will work (and if it does, not very portably ).(我不认为第二个会起作用( 如果确实如此,不是很便携 )。)
The first one should be OK.(第一个应该没问题。)
// HTML:
<input id="theId" value="test" onclick="doSomething(this)" />
// JavaScript:
function(elem){
var value = elem.value;
var id = elem.id;
...
}
This should also work.
(这也应该有效。)
Update: the question was edited.
(更新:问题已被编辑。)
Both of the solutions are now equivalent.(这两种解决方案现在都是等效的。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…