mercredi 29 juin 2016

Using PowerPoint, create a DOM Tree that accurately represents JavaScript code


I am very new to JavaScript and I have an assignment I need some directional help on. First we were to create a code:

<html> 
<header> 
<title>Week 2</title> 
</header> 

<body> 
<h1>JavaScript Greeting:</h1> 

<script language="JavaScript"> 
var myDate = new Date(); 


if ( myDate.getHours() < 12 )  
{ 
    document.write("Good Morning!"); 
} 
else  
if ( myDate.getHours() >= 12 && myDate.getHours() <= 17 ) 
{ 
    document.write("Good Afternoon!"); 
} 
else  
if ( myDate.getHours() > 17 && myDate.getHours() <= 24 ) 
{ 
    document.write("Good Evening!"); 
} 

document.write("<br/><br/> The hour is: ") 
document.write( myDate.getHours() ); 

</script> 

</body> 
</html>

Our next assignment is to take the code we created and use PowerPoint to create a DOM Tree that accurately represents the code above. I am confused at how to proceed and cannot find any examples online on how to turn JavaScript into a DOM tree. I found how to inspect my elements in Chrome, however the code is identical to the code above. Can anyone offer any guidance or examples? It would be greatly appreciated.


Aucun commentaire:

Enregistrer un commentaire