Which code segment should you insert at line 02?

You develop an HTML5 webpage. You have the following JavaScript code:

You need to handle the click event when a user clicks the showDialog button.
Which code segment should you insert at line 02?

You develop an HTML5 webpage. You have the following JavaScript code:

You need to handle the click event when a user clicks the showDialog button.
Which code segment should you insert at line 02?

A.
$ (document).trigger(“click”, “#showDialog”, function (e) {

B.
$ (document).on (“#showDialog”, “click”, function (e) {

C.
$(document).toggle(“click”, “#showDialog”, function (e) {

D.
$(document).on(“click”, “#showDialog”, function (e) {

Explanation:
Syntax: .on( events [, selector ] [, data ], handler )
* Example:
$(function() {
$(document).on(‘click’, ‘.get-widgets’, function (e) {
jQuery .on()



Leave a Reply 1

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


Michał

Michał

It is ok.