CIW JavaScript Fundamentals exam 1D0-435 Question # 6 Topic 1 Discussion

CIW JavaScript Fundamentals exam 1D0-435 Question # 6 Topic 1 Discussion

1D0-435 Exam Topic 1 Question 6 Discussion:
Question #: 6
Topic #: 1

What willthe following JavaScript code do when it runs?

<SCRIPT Language="JavaScript">

<!--

var d=new Date;

var h=d.getHours();

var msg="";

var targ;

if(h<12)

msg="<h1>Good Morning!</h1>";

else if(h>=12 && h<18)

msg="<h1>Good Afternoon!</h1>";

else

msg="<h1>Good Evening!<h1>";

document.write(msg);

/-->

</SCRIPT>


A.

It will write "Good Afternoon!'


B.

If it is before noon, it will write "Good Morining!", if after noon but before 6 pm, "Good Afternoon!" if after 6 pm, "Good Evening!"


C.

It will write "Good Evening!"


D.

It will write "Good Morning!'


Get Premium 1D0-435 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.