华恩JAVA班第55天
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>使用HTML DOM对象的属性访问节点</title>
<script type="text/javascript">
function change(){
function show(){
</script>
</head>
<body>
<img src="images/fruit.jpg" id="s1" alt="水果图片" /><br />
<input name="b1" type="button" value="改变图片" οnclick="change()" />
<input name="b2" type="button" value="显示图片路径" οnclick="show()" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>使用HTML DOM操作表格</title>
<style type="text/css">
body{
table{
}
td{
.center{
}
.title{
}
</style>
<script type="text/javascript">
function addRow(){
var newRow=document.getElementByIdx_x("myTable").insertRow(2);
var col1=newRow.insertCell(0);
col1.innerHTML="幸福从天而降";
var col2=newRow.insertCell(1);
col2.innerHTML="¥18.5";
col2.align="center";
function updateRow(){
function delRow(){
</script>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" id="myTable">
</table>
<input name="b1" type="button" value="增加一行" οnclick="addRow()" />
<input name="b2" type="button" value="删除第2行"
<input name="b3" type="button" value="修改标题"
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>改变图片</title>
<style type="text/css">
img{
body{
}
input{
}
</style>
<script type="text/javascript">
function change(){
</script>
</head>
<body style="text-align:center;">
<img src="images/fruit.jpg" alt="水果图片" id="fruit" />
<br /><input name="btn" type="button" value="改变图片" οnclick="change()" />
</body>
</html>
更多信息可以参见同学富晓磊的博客:http://blog.sina.com.cn/u/1798827371