Presentation is loading. Please wait.

Presentation is loading. Please wait.

Events: Changed and Input

Similar presentations


Presentation on theme: "Events: Changed and Input"— Presentation transcript:

1 Events: Changed and Input
Chris White, Zach Griffiths, Tiffany Philavane, Devin Dixon

2 EVENTS HTML events are "things" that happen to HTML elements.
When JavaScript is used in HTML pages, JavaScript can "react" on these events.

3 EVENTS <button onclick="document.getElementById('demo').innerHTML = Date()">The time is?</button> An HTML event can be something the browser does, or something a user does. Some examples are: An HTML web page that has finished loading An HTML input field that was changed An HTML button that was clicked HTML allows event handler attributes, with JavaScript code, to be added to HTML elements.

4 Common HTML Events

5 onChange The onchange event occurs when the value of an element has been changed. For radiobuttons and checkboxes, the onchange event occurs when the checked state has been changed.

6 Input vs Changed This event is similar to the oninput event. The difference is that the oninput event occurs immediately after the value of an element has changed, while onchange occurs when the element loses focus, after the content has been changed.

7 Example

8 Lab Practice You will be working with the <select> tag to add options to the drop down menu. To do this you will need to incorporate the onChange function into the select tag. Note how the javascript is written for the lab on Thursday.


Download ppt "Events: Changed and Input"

Similar presentations


Ads by Google