Java Script Lesson 2

Java Script with HTML
1 / 18
volgende
Slide 1: Tekstslide
Online wordFoundation Degree

In deze les zitten 18 slides, met interactieve quizzen en tekstslides.

Onderdelen in deze les

Java Script with HTML

Slide 1 - Tekstslide

<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The onclick Event</h2>
<p>How to assign an "onclick" event to a p element:</p>
<p id="demo" onclick="myFunction()">Click me.</p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "YOU CLICKED ME!";}</script></body></html>






Slide 2 - Tekstslide

<h1>HTML DOM Events</h1>
<h2>The onclick Event</h2>
\\Two Elements that prints out important infomation

Slide 3 - Tekstslide

<p>How to assign an "onclick" event to a p element:</p>
<p id="demo" onclick="myFunction()">Click me.</p>

Here in the   paragraph tag an "Id" to identify it.  The " onclick" then calls the "myFunction"

Slide 4 - Tekstslide

Explanation
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "YOU CLICKED ME!";
}
</script>
A Function  call  myFunction gets all the documents Element with "Id= demo" and change it to  "YOU CLICKED ME!";"

Slide 5 - Tekstslide

Create website with that has the following tags- html, head, body

Slide 6 - Open vraag

Use notepad to create a webpage that will respond with " Clicked me" when you activate the button.

Slide 7 - Open vraag

Use notepad to create a webpage that will respond with " Clicked me" when you activate the button will need to have
A
Onclick
B
Id paragraph where your comment will appear
C
Function
D
A script Tag

Slide 8 - Quizvraag

<P Id="Ref", </p>
A
Not significant
B
Reference area
C
The function call will place comments there.
D
Enables Web scripting

Slide 9 - Quizvraag

<button onclick="myFunction()">Click me</button>
A
Calls a function called "my Function ()" when button is clicked
B
Waits until you click a button called "click me"
C
Creates a button called "click me "
D
Creates a button called "on click"

Slide 10 - Quizvraag

<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";}
</script>
A
This a Javascript code
B
The Function will reference "id "demo" in the html document.
C
Function gets the whole html document
D
. " document.getElementById" is a standard Javascript function.

Slide 11 - Quizvraag

<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script> rewrite script to change the "id" to "test" and the text to "I am gaining knowledge"

Slide 12 - Open vraag

<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
Select the associated html elements
A
<p id="demo"></p>
B
<button onclick="Function()>clickme</button>
C
<button onclick="myFunction()>clickme</button>
D
<p ID="demo"></p>

Slide 13 - Quizvraag

A Webpage that responds with " Clicked me" when you activate the button.
Name the different elements.

Slide 14 - Woordweb

how well did you understand Buttons
very well
well
Keep practising

Slide 15 - Poll

How well did you understand Functions
Very well
well
Keep Practicising

Slide 16 - Poll

Today you have the knowledge 
Using Javascript  "document.getElement ById"
 Functions(JavaScript)- They do the work
Functions calls (html) Call the function to do the work
Thank you for learning with us 

Slide 17 - Tekstslide

BYE
The End 

Slide 18 - Tekstslide