HTML, CSS & JavaScript Practice Questions
New question every time · Checked instantlyBuild the page the question asks for, press Check, and every requirement is tested — tags, attributes, CSS rules, and even your JavaScript, by actually clicking your buttons.
Read the question
Change the page colour with JavaScript
Create a button with id "paint". When it is clicked, JavaScript must change the background colour of the <body> to navy.
How This Practice Works
- Read the question. Choose Easy, Medium or Hard if you want a particular level.
- Write your answer in the editor — the preview updates as you type.
- Press Check answer. Every requirement is tested and you see exactly which ones passed.
- Press Next question for a new one. Each question is generated with new values, so you do not get the same one twice.
- Your score and streak are kept on this device. A question counts as solved only if you solve it before opening the solution.
Frequently Asked Questions
How is my web page checked?
The page you write is read like a browser reads it: the tags, attributes and CSS rules the question asks for are looked up, and for JavaScript questions your page is opened in a hidden sandbox where your buttons are really clicked and the result is read back.
Do I have to write a full HTML document?
No. You can write just the body content, or a complete document with <html>, <head> and <body> — both are checked the same way.
Which topics are covered?
Headings and text formatting, ordered and unordered lists, images and links, tables with rowspan and colspan, forms, CSS classes and ids, Flexbox, and JavaScript events and calculations — the NIELIT O Level M2-R5.1 and PR-2 syllabus.
Is it free?
Yes, free and without login. Your score and streak are saved on this device.
