190-804 Free Dumps Study Materials
Question 15: Devon has placed the following code in the JS Header event of a form:
function userConfirm( ) { if( confirm( "Do you wish to continue" )) { promptUser( ); } }
function promptUser( ) { x = prompt( "Please enter some text", "" ); alert( x ); }
There is a button on the form where the onClick event is: userConfirm( ).
Which one of the following will happen when the user chooses "Yes" in the confirmation prompt?
A.The promptUser( ) function will run and display an error message, "Please enter some text".
B.The promptUser( ) function will run and ask the user to input a value, which will then be posted in a
confirm prompt.
C.A run-time error will appear, stating that the promptUser( ) function is undefined, since it was defined
after the userConfirm( ) function.
D.The promptUser( ) function will run with an input prompt asking the user to input a value, which will then
be posted in an alert prompt.
Correct Answer:D