Summer Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

A developer is creating a simple webpage with a button.

A developer is creating a simple webpage with a button. When a user clicks this button for the first time, a message is displayed.

The developer wrote the JavaScript code below, but something is missing. The message gets displayed every time a user clicks the button, instead of just the first time.

01 function listen(event) {

02

03 alert( ' Hey! I am John Doe ' );

04

05 }

06 button.addEventListener( ' click ' , listen);

Which two code lines make this code work as required?

A.

On line 04, use event.stopPropagation();

B.

On line 02, use event.first to test if it is the first execution.

C.

On line 06, add an option called once to button.addEventListener().

D.

On line 04, use button.removeEventListener( ' click ' , listen);

Salesforce JavaScript-Developer-I Summary

  • Vendor: Salesforce
  • Product: JavaScript-Developer-I
  • Update on: Jul 6, 2026
  • Questions: 147
Price: $52.5  $149.99
Buy Now JavaScript-Developer-I PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method