Salta al contenido principal
e-Disciplinas
  • Disciplinas »
    2026 2025 2024 2023 2022 2021 2020 2019 2018 2017 2016 2015 2014 2013 2012 AACCs/FFLCH Pró-Reitoria de Pós-Graduação Outros
  • Suporte »
    Acesso Perfis Ouvintes Docentes Criação de Disciplinas da USP Documentação HelpDesk e Contato Guia de uso Sobre
  • Español - Internacional ‎(es)‎
    Deutsch ‎(de)‎ English ‎(en)‎ Español - Internacional ‎(es)‎ Français ‎(fr)‎ Italiano ‎(it)‎ Português - Brasil ‎(pt_br)‎
  • Cerrar
    Selector de búsqueda de entrada
  • Acessar

SCC0219 - Introdução ao Desenvolvimento Web (2025)

  1. Página Principal
  2. Cursos
  3. 2025
  4. ICMC
  5. SCC
  6. SCC0219-2025
  7. Module 5: DOM & Events
  8. Exercise 8: DOM I

Exercise 8: DOM I

Requisitos de finalización
Apertura: miércoles, 9 de abril de 2025, 08:00
Cierre: miércoles, 9 de abril de 2025, 12:00

Activity: DOM Manipulation and Traversal (80 minutes)


Upload a html file named USPnumber1.USPnumber2.html.

Instructions:

  1. Split into pairs for pair programming. You'll be working together on this activity to practice DOM manipulation and traversal techniques.

  2. Open your preferred code editor or browser-based environments, such as JSFiddle or CodePen.

  3. Start with the following simple HTML structure that includes a variety of elements such as headings, paragraphs, lists, images, and buttons (Change the HTML using only JavaScript):

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>DOM Manipulation Activity</title> </head> <body> <h1>DOM Manipulation Activity</h1> <p>Paragraph 1</p> <p>Paragraph 2</p> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <img src="https://via.placeholder.com/100" alt="Placeholder Image"> <button id="taskButton">Perform Task</button> </body> </html

Your tasks for this activity are:

      1. Change the text of the first paragraph to "New Paragraph 1".
      2. Add a new list item with the text "Item 4" at the end of the unordered list.
      3. Change the src attribute of the image to another URL (e.g., https://via.placeholder.com/200).
      4. Set the background color of the second paragraph to yellow.
      5. Add an event listener to the first paragraph that changes its text to "Clicked!" when clicked.
      6. Add an event listener to the button that, when clicked, performs all the previous tasks in sequence (1, 2, 3, 4, and 5).

5. Work together to complete these tasks using JavaScript DOM manipulation methods, such as getElementById, querySelector, createElement, appendChild, setAttribute, style, and addEventListener.

6. As you work on the activity, feel free to ask your peers or teaching assistant for help or clarification if needed.

7. Once you have completed the activity, take some time to compare your solutions with other pairs. Discuss any challenges you encountered or alternative approaches you discovered.

Remember, the goal of this activity is to practice your DOM manipulation and traversal skills while working collaboratively. Enjoy and have fun!



◄ Quiz 5
Exercise 9: DOM II ►

Bloques

Salta Navegación
  • Página Principal

    • e-Disciplinas

      • Mis cursos

      • Marcas

      • Búsqueda

      • PáginaSobre

      • PáginaHelp Desk e Contato

      • PáginaGuia

    • Mis cursos

    • Cursos

      • 2025

        • CENA

        • EACH

        • ECA

        • EE

        • EEFE

        • EEFERP

        • EEL

        • EERP

        • EESC

        • EP

        • ESALQ

        • FAU

        • FCF

        • FCFRP

        • FD

        • FDRP

        • FE

        • FEA

        • FEARP

        • FFCLRP

        • FFLCH

        • FM

        • FMBRU

        • FMRP

        • FMVZ

        • FO

        • FOB

        • FORP

        • FSP

        • FZEA

        • IAG

        • IAU

        • IB

        • ICB

        • ICMC

          • SMA

          • SME

          • 550

          • SSC

          • SCC

            • TCCs do SCC

            • SCC0211-2025

            • SCC5920--2025

            • SCC0124-201-2025

            • SCC0283-201-2025

            • SCC0271-201-2025

            • SCC0230-202-2025

            • SCC5878-2025

            • SCC0233-201-2025

            • SCC0295-201-2025

            • ED - SCC0122 - 2025

            • SCC0634-201-2025

            • SCC0245-201-2025

            • SCC0607-201-2025

            • SCC0220-201-2025

            • LabBD-SCC0641-2025

            • SCC0560-201-2025

            • SCC5836--2025

            • SCC0252-201-2025

            • SCC0219-201-2025

            • SCC0202-2025

            • SCC5977--2025

            • SCC5809--2025

            • SCC5960--2025

            • SCC5959--2025

            • SCC5952--2025

            • SCC0277-201-2025

            • SCC0218-2025

            • SCC0227/SCC0229--2025

            • SCC0505--2025

            • SCC5832--2025

            • SCC0205-202-2025

            • SCC0205-201-2025

            • SCC0502-201-2025

            • SCC0223-201-2025

            • SCC0207-2025

            • SCC0580-201-2025

            • SCC0302-2025

            • SCC5949--2025

            • SCC5982--2025

            • SCC0216-2025

            • SCC0219-2025

              • General

              • Group Assignment

              • Course Introduction

              • Module 1: HTTP Protocol

              • Module 2: HTML

              • Module 3: CSS

              • Module 4: JavaScript

              • Module 5: DOM & Events

                • TareaExercise 8: DOM I

              • Module 6: AJAX Calls

              • Milestone 1

              • Module 7: React or Vue

              • Module 8: Node.js/ExpressJS

              • Milestone 2

              • Module 9: NoSQL Databases

              • Final Presentations

              • Final Test

          • EST

          • MAI

          • SMA

        • IEB

        • IEE

        • IF

        • IFQSC

        • IFSC

        • IGc

        • IME

        • IO

        • IP

        • IPEN

        • IQ

        • IQSC

        • IRI

        • HRAC

        • MAC

        • MAE

        • MP

        • MZ

        • RUSP

      • 2026

      • 2024

      • 2023

      • 2022

      • 2021

      • 2020

      • 2019

      • 2018

      • 2017

      • 2016

      • 2015

      • 2014

      • 2013

      • 2012

      • Grupos de Estudos, Pesquisa e Outros

      • PRPG - Pró-Reitoria de Pós-Graduação

      • STI

Bloques suplementarios

En este momento está usando el acceso para invitados (Acceder)
Desarrollado por Moodle