Objective: Manipulate mouseover, mouseout, click and dblclick events to modify a table's style.
- Create an HTML table with multiple rows.
- When hovering a row, it turns gray.
- When leaving a row, it returns to normal.
- A click toggles the gray color.
- A double-click resets the row.
Objective: Display a clock that updates every second.
- Create an empty
element with id "clock".
- Write a function that gets the current time (hh:mm:ss).
- Display the time in the element, updating every second using setInterval.
Objective: Modify an element's style using keyboard keys.
- On pressing key A: Add a red border to the table.
- On pressing key R: Reset the border to black.
Objective: Intercept form submission and display the value.
- Create a text field + submit button.
- On button click, display the user's input in a paragraph below the form.
- Prevent page reload with e.preventDefault().
Objective: Create basic authentication in JavaScript.
- Create two fields: username and password.
- Create a login button.
- If user enters "admin" and "1234", display "Welcome".
- Otherwise, display "Invalid credentials".
Objective: Dynamically change the page theme.
- Add a "Toggle Theme" button.
- When clicked, add/remove a "dark-mode" class to body.
- Define associated CSS styles in .dark-mode (dark background, light text).