QuestionQ25

VerifiedAdobe Experience Manager Sites

An Adobe Commerce developer wants to apply a Knockout binding to a <div> to execute the onClick() function when it is clicked.

Which two solutions should the developer use to accomplish this?

Explanation

Knockout’s click binding registers a JavaScript function to run when the associated DOM element is clicked. The binding must receive the function reference, as in click: onClick; invoking onClick() during binding evaluation does not register it as the event handler. Only one listed choice is valid, so the item’s “Choose two” instruction is inconsistent with its options.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!