Kerala Plus Two Computer Science (DHSE) study materials
Kerala Plus Two Computer Science (DHSE) study resources

Kerala Plus Two Computer Science (DHSE): Web Technology: HTML, CSS and JavaScript

Kerala Plus Two Computer Science (DHSE) · Work through your exam, one topic at a time.

All guide sections

Web Technology: HTML, CSS and JavaScript

Web Technology: HTML, CSS and JavaScript

The exam tests document structure, presentation rules, and client-side behaviour, including form validation.

HTML

  • HTML describes structure with elements and attributes: <html>, <head>, <body>, headings, lists, links, images, tables, forms.
  • Attributes use name='value'; tags nest properly.
  • Forms collect input; action sends data to a server, method is usually GET or POST.

CSS

  • CSS controls presentation. Three placements: inline (style attribute), internal (<style>), external (.css linked with <link>).
  • Selectors: element, .class, #id. Specificity order: inline > id > class > element.
  • Box model: content, padding, border, margin.

JavaScript

  • Runs in the browser; adds interactivity and validation.
  • Variables via let/const; functions; DOM access with document.getElementById().
  • Events such as onclick, onsubmit, onchange; return false from a handler can cancel submission.

Worked example

A form field id='age' is validated on submit: read let a = document.getElementById('age').value; then if (a === '' || isNaN(a)) { alert('Enter a number'); return false; }. Reasoning: value is a string; isNaN checks numeric validity; returning false stops the form from being sent, so invalid data never reaches the server.

Traps

  • Using = instead of === in conditions.
  • Assuming JavaScript runs on the server; it runs client-side here.
  • Expecting CSS id selectors to be written with .; ids use #.
  • Placing <script> before the elements it accesses without handling load order.
  • Relying only on client-side validation; server-side validation is still required.