DHTML的简单示例,动态改变页面

发表于:2007-06-21来源:作者:点击数: 标签:
html head titleDHtml举例12/title style body {font-family:"宋体";color="blue";font-size="9pt"} /style script language=" Java script" function changeText() { DT.innerText="我很好!"; }//function function changeHtml() { DH.innerHTML="iu我姓贵!

   

<html>
<head>
<title>DHtml举例12</title>
<style>
 body {font-family:"宋体";color="blue";font-size="9pt"}
</style>
<script language="Javascript">
function changeText()
{

 DT.innerText="我很好!";
}//function


function changeHtml()
{
 DH.innerHTML="<i><u>我姓贵!</u></i>";
}//function


function back()
{
 DT.innerText="您好吗?";
 DH.innerHTML="您姓什么?";
}
</script>
</head>


<body>
<p><font color="gray">请点击下边的文字……</font>
<ul>
<li id="DT" Onclick="changeText()">您好吗? </li>
<li id="DH" Onclick="changeHtml()">您姓什么? </li>
<li Onclick="back()">恢复原样! </li>
</ul>
</body>
</html>

原文转自:http://www.ltesting.net