Web Design

Java Script with HTML
1 / 19
next
Slide 1: Slide
Online wordFoundation Degree

This lesson contains 19 slides, with interactive quizzes and text slides.

Items in this lesson

Java Script with HTML

Slide 1 - Slide

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

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

Slide 3 - Slide

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

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

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

Slide 6 - Open question

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

Slide 7 - Open question

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

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

Slide 9 - Quiz

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


A

Slide 11 - Quiz

<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 12 - Quiz

<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 13 - Open question

<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 14 - Quiz

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

Slide 15 - Mind map

how well did you understand Buttons
very well
well
Keep practising

Slide 16 - Poll

How well did you understand Functions
Very well
well
Keep Practicising

Slide 17 - 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 18 - Slide

BYE
The End 

Slide 19 - Slide