liveBook · Manning

HTML

As explained in Acing the Frontend Interview

HTML is the standard markup language for structuring documents and user interfaces on the web.

HTML is an interview-relevant foundation for web development and frameworks such as React. Strong answers connect markup fundamentals with browser behavior, accessibility, performance, and maintainable implementation. section 2.0

Interviewers commonly probe whether a candidate can:

  • Explain how HTML and CSS support web interfaces while JavaScript and TypeScript provide programming capabilities around them. section 2.0
  • Use HTML APIs beyond framework abstractions, including device access, clipboard operations, drag-and-drop, file access, storage, multimedia, messaging, and real-time communication. section 2.3
  • Consult official documentation rather than memorizing every API, then account for permissions, compatibility, errors, accessibility, user experience, and resource management. section 2.3

Interview scenario: implement drag and drop

A practical solution stores an element identifier with dataTransfer during drag start, prevents the default drag-over behavior, retrieves the identifier on drop, and appends the matching element to the drop zone. The example uses React event handlers while exercising a browser HTML API directly. section 2.3

Listing 2.7 The drag-and-drop example
const DragAndDrop: React.FC = () => {
  const handleDragStart = (e: React.DragEvent<HTMLDivElement>) => {
    e.dataTransfer.setData('savedId', e.currentTarget.id); #A
  };
  const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {
    e.preventDefault(); #B
  };
  const handleDrop = (e: React.DragEvent<HTMLDivElement>) => {
    const data = e.dataTransfer.getData('savedId'); #C
    const draggableElement = document.getElementById(data);
    const dropzone = e.target as HTMLElement;
    dropzone.appendChild(draggableElement!); #D
  };
  return (
    <div>
      <h1>Drag and Drop API Demo</h1>
      <div id="draggable" draggable="true" onDragStart={handleDragStart}> #E
        I am draggable.
      </div>
      <div #F
        id="dropzone"
        onDragOver={handleDragOver}
        onDrop={handleDrop}
      >
        Drop Zone
      </div>
    </div>
  );
};

Inspect the complete drag-and-drop implementation, including draggable markup, event handlers, dataTransfer usage, and drop-zone behavior. section 2.3

How Acing the Frontend Interview covers it

How deep it goes
Moves from foundational HTML knowledge to practical HTML API integration, while deferring exhaustive API memorization.
Examples
Uses camera access and a React drag-and-drop interface to demonstrate direct interaction with browser capabilities.
What you can do after
Apply HTML APIs in React applications by consulting documentation and addressing compatibility, permissions, errors, accessibility, and user experience.
How it connects
Connects HTML with CSS, JavaScript, TypeScript, React, browser APIs, accessibility, permissions, and resource management.

Also explained in

Compare how 16 books explain HTML →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Frontend Interview. The section links point to the parts of the book it draws on.