<html>
<head>
<script type="text/javascript">
function getValue()
{
var x=document.getElementById("myHeader")
var date = new Date()
var today = "现在是:"
var time="今天是"+date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日 "+ date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
var z= document.getElementById("today")
alert("今天是"+date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日 "+ date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds())
}
function getValue2()
{
var y=document.getElementById("myHeader2")
alert(y.innerHTML)
}
</script>
</head>
<body>
<p1 id="myHeader" οnclick="getValue()">这是我的标题</p1>
<p>点击标题,会提示出它的值。</p>
<p1 id="myHeader2" οnclick="getValue2()">这也是我的标题</p1>
<p>点击标题,会提示出它的值。</p>
</body>
</html>
<head>
<script type="text/javascript">
function getValue()
{
var x=document.getElementById("myHeader")
var date = new Date()
var today = "现在是:"
var time="今天是"+date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日 "+ date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
var z= document.getElementById("today")
alert("今天是"+date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日 "+ date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds())
}
function getValue2()
{
var y=document.getElementById("myHeader2")
alert(y.innerHTML)
}
</script>
</head>
<body>
<p1 id="myHeader" οnclick="getValue()">这是我的标题</p1>
<p>点击标题,会提示出它的值。</p>
<p1 id="myHeader2" οnclick="getValue2()">这也是我的标题</p1>
<p>点击标题,会提示出它的值。</p>
</body>
</html>