1D0-635 Practice Test & Exam Dumps
1D0-635 CIW JavaScript Specialist (page: 10)

Updated On: 16-Aug-2023
QUESTION: 26
You want to add a personalized interaction with your users when they enter your Web site. To
do this, you can display a JavaScript prompt on the home page that asks the user to enter her
name. When the user enters text and clicks the OK button, an alert dialog box will appear and
display the text "Welcome, name" (where name is the text entered by the user). Which choice
shows the correct JavaScript code for this action?

A. alert("Welcome, " + prompt("What is your name?", ""));
B. alert("Welcome, ") + prompt("What is your name?", "");
C. prompt("What is your name?", "") + alert("Welcome, ");
D. prompt("What is your name?", "" + alert("Welcome, "));
Answer(s): A
QUESTION: 27
In an X/HTML form, which script block will retrieve an input value and display it back without
errors or warnings?

A. <script type="text/javascript">
function ShowEntry() {
var inp = document.getElementById("i");
var s = inp.value;
d.value = s; }
</script>

<input id="i" onchange="ShowEntry()" /><br />
You entered: <span id="d"></span>
B. <script type="text/javascript">
function ShowEntry() {
document.getElementById("i");
var s = i.innerHTML;
document.getElementsByName("d").innerHTML = s; }
</script>

<input id="i" onchange="ShowEntry()" /><br />
You entered: <span id="d"></span>
C. <script type="text/javascript">
function ShowEntry() {
var inp = document.getElementById("i");
var s = inp.value;
document.getElementsbyName("d").innerHTML = s; }
</script>

<input id="inp" onchange="ShowEntry()" /><br />
You entered: <span id="d"></span>
D. <script type="text/javascript">
function ShowEntry() {
var inp = document.getElementById("i");
11
Viewing page 10 of 22
Viewing questions 33 - 36 out of 55 questions


Post your Comments and Discuss CIW 1D0-635 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!