您的位置:首页 > Web前端 > JavaScript

javascript 中 with的用法:(简化语句)

2012-01-04 16:31 387 查看
with(document.getElementById(“userFrom”)) {

method = “post”;

action = “user_add.jsp”;

submit();

}

相当于:

document.getElementById(“userForm”).method = “post”;

document.getElementById(“userForm”).action = “user_add.jsp”;

document.getElementById(“userForm”).submit();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: