PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are creating a Virtual Earth 6.0 application.

A Web page of the application contains the following code segment.

control = document.createElement (“div”);
control.id = ” CustomControl “;

A custom control must be added on top of the map on the Web page.

You need to ensure that the custom control responds only to its own mouse-click events.
Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
control.innerHTML = “<input type=’button’ value=’Click’ onclick =’ ClickHandler ()’ />”; map.AddControl (control);

B.
control.innerHTML = “<input type=’button’ value=’Click’ />”; map.AddControl (control); map.AttachEvent (” onclick “, ClickHandler );

C.
control.innerHTML = “<input type=’button’ value=’Click’ onclick =’ ClickHandler ()’ />”; document.getElementById (‘Map’). appendChild (control);

D.
control.innerHTML = “<input type=’button’ value=’Click’ />”; document.getElementById (‘Map’).
appendChild (control); document.getElementById (‘ CustomControl ‘). attachEvent (” onclick “, ClickHandler );


Leave a Reply