不知道为什么firebug总提示,参数character illegal,新手求指点!
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p><input type="text" value="北京市" /></p>
<p><input type="text" value="朝阳区" /></p>
<p><button>传参</button></p>
<script type="text/javascript">
var Oshow = function(a,b) {
// body...
alert(a.value);
alert(b.value);
};
window.onload = function() {
var Oadr = document.getElementsByTagName("input");
var obtn = document.getElementsByTagName("button")[0];
obtn.onclick = function() {
Oshow(Oadr[0],Oadr[1]);
}
}
</script>
</body>
</html>