我想知道两者的效果是什么id
以及function
何时相同。例子:
<tr> <td><img id='deleteAuthor' onclick='javascript: deleteAuthor(this)' src='images/close.png' /></td></tr>";
function deleteAuthor(element){
alert(element);
}
output:TypeError: deleteAuthor is not a function
[Break On This Error]
<tr> <td><img id='deleteAuthorbt' onclick='javascript: deleteAuthor(this)' src='images/close.png' /></td></tr>";
function deleteAuthor(element){
alert(element);
}
output:Object HTMLImageElement
请问为什么会这样?