Past-paper question · 2018 May-June · Paper 33 · Q2

Question 2 2018 · May-June · Paper 33 · 6 marks

Original past-paper question for 2
Original past-paper question for 2
Reveal official mark-scheme answer Official mark-scheme answer for 2

Official answer for Question 2

✓
A suitable line of code would be:

Question 6

✓
document.getElementById(“button1”).addEventListener(“click”,
✓
checkreadpagefunction);
✓
Six from:
✓
1 mark for each of:
✓
Capturing the element:
✓
document.getElementById
✓
Identifying the button by name:
✓
“button1”
✓
Checking for the event:
✓
addEventListener
✓
Correct reference to click by mouse:
✓
“click”,
✓
Calling the correct function by name:
✓
checkreadpagefunction);
✓
All correct delimiters and all correct brackets:
✓
. between key words, , after click AND ; after function
✓
() around button1
✓
() around parameter (“click”, checkreadpagefunction);
✓
9626/33
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2018
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9626_s18_ms_33.pdf →

Show text version of question

Question 2

The use of JavaScript within the HTML code of a web page allows the page to react to user intervention. The code below contains a function named checkreadpagefunction that will ask the user to confirm that the page has been read.

Complete the JavaScript code by writing extra code that will capture the click event and execute the function.

<html> <body> <p>Click on the button to confirm that you have read this page.</p> <button id="button1">Click here</button> <script>

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

......................................................................................................................................................[6]

function checkreadpagefunction() { alert ("I have read this page."); } </script> </body> </html>

You may use the space below for any rough work.

Question 5

Topic relevance

Why this question appears here

98% assigned-topic match · Programming for the web

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9626_s18_qp_33.pdf

Keep practising this topic