Which two code segments can you use? (Each correct answer presents a complete solution

You are creating a JavaScript function that displays the name of a web application. You declare the following button element.
<input type=”button” id= “About” value=”About” />
When a user clicks the button, a JavaScript function named About must be called.
You need to create an event handler that calls the About function when the button is clicked.
Which two code segments can you use? (Each correct answer presents a complete solution. Choose two.)

You are creating a JavaScript function that displays the name of a web application. You declare the following button element.
<input type=”button” id= “About” value=”About” />
When a user clicks the button, a JavaScript function named About must be called.
You need to create an event handler that calls the About function when the button is clicked.
Which two code segments can you use? (Each correct answer presents a complete solution. Choose two.)

A.
var button = document.getElementById(“About”);
ScriptEngine.call(button, About());

B.
var button = document.getElementById(“About”);
ScriptEngine.bind(button, About());

C.
var button = document.getElementById(“About”);
button.addEventListener(“click”, About);

D.
var button = document.getElementById(“About”);
button.attachEvent(“onclick”, About);



Leave a Reply 1

Your email address will not be published. Required fields are marked *


David

David

[attachEvent is no longer supported. Starting with Internet Explorer 11, use addEventListener.