<!DOCTYPE html>
<html>
<body>
<button onclick = "getElementById('demo').innerHTML=Date()">The time is?</button>
<button onclick = "this.innerHTML=Date()">The time is?</button>
<p id = "demo">แสดงข้อมูลก่อนการ Click</p>
</body>
</html>
<html>
<body>
<button onclick = "getElementById('demo').innerHTML=Date()">The time is?</button>
<button onclick = "this.innerHTML=Date()">The time is?</button>
<p id = "demo">แสดงข้อมูลก่อนการ Click</p>
</body>
</html>
ตัวอย่างการเปลี่ยนแปลง content ในหน้าเพจแบบ on the fly ด้วย javascript , ตัวอย่างนี้ยังไม่ใช้ jQuery เข้ามาประกอบครับ
0 ความคิดเห็น