87,955
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type='text/javascript' src='js/liukai.js'></script>
<script type='text/javascript'>
window.onload = function(){
//var e = document.createEventObject();
var element = document.getElementById('id2');
//element.fireEvent('ok',e);
element.attachEvent('onclick',function(){alert('ok!');});
element.fireEvent('onclick');
}
window.onerror = function(msg,url,line){
if(onerror.num ++ < onerror.max){
alert('发生错误:' + msg + '\n地址:' + url + '\n行数:' + line);
return true;
}
}
onerror.num = 0;
onerror.max = 3;
</script>
</head>
<body>
<form>
<tr>
<td><input id='id2' type='text' value='asdasd' onclick="alert(forms[forms.length - 1].childNodes.item(2).nodeName);"/></td>
<td></td><a href="#" id="aa">asdasdasdasda</a></td>
</tr>
</form>
</body>
</html>
<td><input id='id2' type='text' value='asdasd' onclick="alert(this.forms[forms.length - 1].childNodes.item(2).nodeName);"/></td>
<td><input id='id2' type='text' value='asdasd' onclick="alert(this.form.childNodes.item(2).nodeName);"/></td>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<body>
<form name="2">
<tr>
<td><input id='id2' type='text' value='asdasd' onclick="alert(this.form.name);"/></td>
<td></td><a href="#" id="aa">asdasdasdasda</a></td>
</tr>
</form>
</body>
</html>
<td><input id='id2' type='text' value='asdasd' onclick="alert(this.tagName);"/></td>
<td><input id='id2' type='text' value='asdasd' onclick="alert(this.tagName);"/></td>
<td><input id='id2' type='text' value='asdasd' onclick="open()"/></td>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<body>
<form>
<tr>
<td><input id='id2' type='text' value='asdasd' onclick="alert(this.forms.length);"/></td>
<td></td><a href="#" id="aa">asdasdasdasda</a></td>
</tr>
</form>
</body>
</html>