jQuery Basic #2 - Change Content On the Fly - onclick

Demo From : tryjs_event_onclick , tryjs_events1

<!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>

ตัวอย่างการเปลี่ยนแปลง content ในหน้าเพจแบบ on the fly ด้วย javascript , ตัวอย่างนี้ยังไม่ใช้ jQuery เข้ามาประกอบครับ

แสดงความคิดเห็น

0 ความคิดเห็น