javaScript中如何使用DOM解析
1、<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>

2、<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Dom树</title>

3、<script type="text/javascript"> function show(){ document.getElementById("info").innerHTML="<h1>helloWord</h1>"; }

1、</script></head><body> <form action="" method="post"> <input type="button" onclick="show()" value="显示"> <span id="info"></span> </form></body></html>

2、本程序中定义了一个普通的按钮,当点击此按钮的时候,会调用show()函数,在show()函数中,将取得设为info的元素。并设置其中的显示内容,

3、DOM解析是将所有的内容读取到内存中,并形成内存树。如果文件较大则无法使用,但是通过DOM解析可以进行文件内容的修改。javaScript本身具备了进行DOM操作的能力,可以直接在javaScript中通过DOM操作HTML代码;
