• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 8 páginas
Examen

Practice A Test Javascript Ciw Questions And Answers

Document preview thumbnail
Vista previa 2 fuera de 8 páginas

PRACTICE A TEST JAVASCRIPT CIW QUESTIONS AND ANSWERS

Vista previa del contenido

PRACTICE A TEST JAVASCRIPT CIW
QUESTIONS AND ANSWERS



You want to include in your form a button labeled Edit, which changes to Save when in
edit mode and changes back to Edit when the form contents are saved. You are calling
a function from the onclick event handler to perform this task. Which of the following is
the correct code for that function? - Correct Answers -if(myButton.value =="Edit") {
myButton.value = "Save";
}
else{
myButton.value = "Edit";
}

Which of the following is a valid variable name in JavaScript? - Correct Answers -sink

Which of the following correctly defines an object with a property called height, a
property called width, and a method called getArea? - Correct Answers -function
objRectangle(height, width) {
this.height = height;
this.width = width;
this.getArea = getArea;
}

Consider the following expression:

x = 25;
y = 10;
Which statement would evaluate to true? - Correct Answers -x > = y;

You work for a mid-size company with a large Web site that has a very wide customer
base. Which is the best method for testing your JavaScript code for this site? - Correct
Answers -Test in various browsers, versions and operating systems.

Consider the following code:

<script type="text/javascript">
var v1 = "Blue";
function f ()
{

, this.v1 = "Green";
alert (this.v1);
}
f();
alert (v1);
</script>

What is the expected result when this script is run in the browser? - Correct Answers -
Two alert boxes, both displaying Green

What is a pop-up blocker? - Correct Answers -A browser-level security feature

Consider the following statement:

Cookies can be used to store passwords so authentication is not necessary for
returning users.

Which of the following choices about this statement is accurate? - Correct Answers -The
statement is true, but this practice poses a security risk.

Which code will correctly declare the calendarYear variable as a date object? - Correct
Answers -var calendarYear = new Date();

Consider the following code:

<html><head>
<script type="text/javascript">
function validatePhone(phoneField) {
var pattern = /[A-Z]/;
if (phoneField.match(pattern) != 0 || phoneField.match(pattern) != null) {
alert("Please enter only numbers in the phone number field"); }else{
document.myForm.submit();
}
</script></head>
<body>
<form name="myForm" action="confirmation.htm" onsubmit="return
validatePhone(this.phoneNumber; return false;)" >
Name: <input type="text" name="userName"/><br/>
Phone Number: <input type="text" name="phoneNumber"/><br/>
<input type="submit" value="Submit"/>
</form></body></html>

What should the pattern be in order to more accurately filter the phone number? -
Correct Answers -var pattern = /[\d-()\W]/g;

Consider the following code:

Información del documento

Subido en
29 de octubre de 2025
Número de páginas
8
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
millyphilip
3.7
(563)
Vendido
3019
Seguidores
1965
Artículos
48000
Última venta
7 horas hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes