\n

For help please click on the icon below

\n\n\n```\n\n(i) Re-write the line of code which will use a JavaScript event to call the function displayHelp when the image 'question.jpg' is clicked.\n\n(ii) Explain why the text is still not displayed when the function displayHelp is called.\n\n(e) All customers have electricity meters and some customers also have a gas meter. The HTML code below allows these customers to enter their meter readings.\n\n```\n
\nElectricity Meter Reading
\n\nGas Meter Reading
\n\n\n
\n```\n\nRe-write the line of HTML code to ensure that a reading has been entered for the electricity meter.","eduQuestionType":"Open ended","url":"https://simplestudy.cloud/gb/content/questions/scottish-higher/_/computing-science/web-design-and-development-implementation/energy-supplier-website-css-js-questions","dateModified":"2025-09-28T20:20:04.461Z","inLanguage":"en","acceptedAnswer":{"@type":"ItemList","itemListElement":[{"@type":"ListItem","position":1,"name":"Complete the CSS rule that will change the colours to black and white if the cursor moves over a link.","item":"```css\nnav ul li a:hover {\n background-color: black;\n color: white;\n}\n```"},{"@type":"ListItem","position":2,"name":"Explain why this CSS rule displays the contents of the elements side by side.","item":"The CSS rule `p { display: inline; }` changes the display type of the `

` elements from block (which takes full width) to inline. This allows them to sit next to each other rather than stacking vertically."},{"@type":"ListItem","position":3,"name":"Re-write the line of code which will use a JavaScript event to call the function displayHelp when the image 'question.jpg' is clicked.","item":""},{"@type":"ListItem","position":4,"name":"Explain why the text is still not displayed when the function displayHelp is called.","item":"The text is not displayed because the ID 'display' is not associated with any element in the HTML. The function is trying to access an element that does not exist."},{"@type":"ListItem","position":5,"name":"Re-write the line of HTML code to ensure that a reading has been entered for the electricity meter.","item":""}]},"provider":{"@type":"EducationalOrganization","name":"SimpleStudy","logo":{"@type":"ImageObject","url":"https://cdn.simplestudy.cloud/assets/frontend/img/favicon.png","width":"192","height":"192"},"url":"https://simplestudy.cloud"},"offers":{"@type":"Offer","price":"0","priceCurrency":"GBP","availability":"https://schema.org/InStock","url":"https://simplestudy.cloud/signup/country"},"educationalLevel":"Scottish Highers","educationalAlignment":[{"@type":"AlignmentObject","alignmentType":"educationalSubject","targetName":"Computing Science"},{"@type":"AlignmentObject","alignmentType":"educationalTopic","targetName":"Web Design and Development-Implementation"}],"teaches":["Web Design and Development-Implementation for Scottish Highers Computing Science","Scottish Highers Computing Science exam preparation","Web Design and Development-Implementation exam questions"],"learningResourceType":["Exam Questions"],"audience":{"@type":"EducationalAudience","educationalRole":"Student","audienceType":"Scottish Highers"},"interactivityType":"active","isAccessibleForFree":true,"contentLocation":{"@type":"Place","name":"Online"},"publisher":{"@type":"EducationalOrganization","name":"SimpleStudy","logo":{"@type":"ImageObject","url":"https://cdn.simplestudy.cloud/assets/frontend/img/favicon.png","width":"192","height":"192"},"url":"https://simplestudy.cloud"},"review":{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":"5","bestRating":"5"},"author":{"@type":"Person","name":"SimpleStudy Student"},"reviewBody":"SimpleStudy made revision simple, with easy to study resources for Scottish Highers Computing Science."},"potentialAction":[{"@type":"ViewAction","target":"https://simplestudy.cloud/gb/content/questions/scottish-higher/_/computing-science/web-design-and-development-implementation/energy-supplier-website-css-js-questions"},{"@type":"RegisterAction","target":"https://simplestudy.cloud/signup/country"}],"mainEntityOfPage":{"@type":"WebPage","speakable":{"@type":"SpeakableSpecification","cssSelector":["[data-seo-id=\"heading\"]"]},"breadcrumb":{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"SimpleStudy","item":"https://simplestudy.cloud"},{"@type":"ListItem","position":2,"name":"Scottish Highers","item":"https://simplestudy.cloud/scottish-higher"},{"@type":"ListItem","position":3,"name":"Computing Science","item":"https://simplestudy.cloud/scottish-higher/computing-science"},{"@type":"ListItem","position":4,"name":"An energy supplier's website allows customers to log in and manage their account online","item":"https://simplestudy.cloud/gb/content/questions/scottish-higher/_/computing-science/web-design-and-development-implementation/energy-supplier-website-css-js-questions"}]}}}

Photo AI

An energy supplier's website allows customers to log in and manage their account online - Scottish Highers Computing Science - Question 16 - 2022

Question icon

Question 16

An-energy-supplier's-website-allows-customers-to-log-in-and-manage-their-account-online-Scottish Highers Computing Science-Question 16-2022.png

An energy supplier's website allows customers to log in and manage their account online. (a) They are redesigning their home page and want to implement the spacings... show full transcript

Worked Solution & Example Answer:An energy supplier's website allows customers to log in and manage their account online - Scottish Highers Computing Science - Question 16 - 2022

Step 1

Complete the CSS rule that will change the colours to black and white if the cursor moves over a link.

96%

114 rated

Answer

nav ul li a:hover {
    background-color: black;
    color: white;
}

Step 2

Explain why this CSS rule displays the contents of the elements side by side.

99%

104 rated

Answer

The CSS rule p { display: inline; } changes the display type of the <p> elements from block (which takes full width) to inline. This allows them to sit next to each other rather than stacking vertically.

Step 3

Re-write the line of code which will use a JavaScript event to call the function displayHelp when the image 'question.jpg' is clicked.

96%

101 rated

Answer

<img src='question.jpg' onclick='displayHelp()'>

Step 4

Explain why the text is still not displayed when the function displayHelp is called.

98%

120 rated

Answer

The text is not displayed because the ID 'display' is not associated with any element in the HTML. The function is trying to access an element that does not exist.

Step 5

Re-write the line of HTML code to ensure that a reading has been entered for the electricity meter.

97%

117 rated

Answer

<input type='number' name='electricity' required>

Join the Scottish Highers students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;