with语句用于设置代码在特定对象中的作用域。例:
<script language="javascript" type="text/javascript">
//with语法
var sMessage="hello world";
with(sMessage)
{
document.write(toUpperCase(),"<br />");
document.write(length,"<br />");
}
</script>