很多时候,我们需要在javascript脚本里面对form表单的属性进行设值。例如:
document.getElementByid('form').action = 'target.jsp';
document.getElementByid('form').method = 'post';
document.getElementByid('form').submit();
上面的情况我们可以这样写:
with(document.getElementByid('form')){
action = 'target.jsp';
method='post';
submit();
}