Short Q/A Programing Fundamentals - Students Free Notes

What is Document Object Model? Explain with the help of an example.

Document Object Model (DOM) – Detailed Explanation The Document Object Model (DOM) is a programming interface for web documents. It represents the structure of a document, such as an HTML or XML document, as a tree of objects. The DOM provides a way for programs (typically JavaScript) to interact with the structure, content, and style … Read more

Infer about External CSS. Where is it generally used?

External CSS is a separate stylesheet file that defines the design and layout of a webpage. It is linked using the <link> tag in the <head> section of an HTML document: <link rel=”stylesheet” href=”styles.css”> External CSS is widely used in large projects to maintain consistency and reduce redundancy. It allows easy updates across multiple pages … Read more

How is event-based code used in JavaScript?

Event-based code in JavaScript executes functions when a specific event occurs, such as a click, hover, or key press. This is achieved using event listeners like onclick, onmouseover, and onkeydown. For example: <button onclick=”alert(‘Button clicked!’)”>Click Me</button> Here, when the button is clicked, an alert box appears. JavaScript’s addEventListener() method provides more control by allowing multiple … Read more

Explain the role of tag-pair in a document.

The <body> tag in HTML defines the main content of a webpage that is visible to users. It contains text, images, tables, links, videos, and other elements necessary for a webpage’s functionality. All structural elements such as <h1>, <p>, <div>, and <table> are enclosed within the <body> tag. This tag also allows styling through attributes … Read more

List the frequent tags used in the text of a webpage and their usage.

Some commonly used HTML text-related tags include: <p>: Defines a paragraph. <h1> to <h6>: Defines headings, from largest to smallest. <b>: Makes text bold. <i>: Italicizes text. <u>: Underlines text. <br>: Inserts a line break. <hr>: Inserts a horizontal line. <strong>: Highlights important text. <em>: Emphasizes text with italics. These tags are essential for structuring … Read more

Enlist the optional parameters to open a webpage.

When opening a webpage using JavaScript’s window.open() function, several optional parameters can be specified: 1. URL – Defines the web page to open. 2. Name – Specifies the name of the new window or tab. 3. Features – Defines window properties such as: width and height for window dimensions top and left for positioning resizable=yes/no … Read more

What is ‘href’ and how is it used

‘href’ stands for “Hypertext Reference” and is an attribute used in HTML anchor (<a>) tags to define the URL of a hyperlink. It is used to link different web pages or resources such as images, files, and other websites. The syntax is: <a href=”https://example.com”>Click Here</a>. When users click the link, they are directed to the … Read more

Contrast between website and web application.

A website is a collection of web pages that provide information and resources to users. It is primarily static and does not require user interaction beyond navigation. Websites are generally built using HTML, CSS, and sometimes JavaScript. On the other hand, a web application is an interactive program accessed through a browser, allowing users to … Read more