ExamGecko
Question list
Search
Search

List of questions

Search

Question 194 - Certified B2B Commerce Administrator discussion

Report
Export

A Northern Trail Qutfitters (NTO) developer made a tile component. To expose a click event and react to user input using the markup below, what should replace

<CLICK_EVENT>?

<template>

,

- <a onclick=CLICK_EVENT>

: {product.fields.Name.value}

p

: <fa>

I

1 <[template>

A.
tileClick()
Answers
A.
tileClick()
B.
{eventiileClick}
Answers
B.
{eventiileClick}
C.
javascript:void(0);tileClick();
Answers
C.
javascript:void(0);tileClick();
D.
{tileClick}
Answers
D.
{tileClick}
Suggested answer: B

Explanation:

To expose a click event and react to user input in a Lightning web component, we need to use an event handler function that is defined in the component's JavaScript file. The event handler function must have a parameter that represents the event object, which contains information about the event, such as the target element, the type of event, and any custom data. To register an event handler function in the HTML template, we need to use curly braces and the event object name as the value of the onclick attribute. For example, if we have an event handler function named tileClick that takes an event parameter, we can register it in HTML as:

The event object name can be any valid identifier, but it is a common convention to use event as the name. Therefore, the correct answer is B

asked 23/09/2024
Mohamed Isaaq
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first