💻

Coding Exercises

0/8

Write code, click Run, watch it execute in the live iframe. Click 'Show solution' only when stuck.

A — Simple page

Task: Write an HTML page with title "My Page", a heading "Welcome", and a paragraph "This is my first page."

B — Form

Task: Write a form with name (text), email, age (number), and a submit button.

C — Bootstrap 3-card row

Task: Display 3 cards in a row using Bootstrap, each with an image and a title.

D — JS: greet button

Task: When a button is clicked, read text from input #name and show 'Hello <name>' in div #output.

E — JS: sum an array

Task: Write a function sum(arr) that returns the total. Call it on [1,2,3,4,5] and show in <pre id='out'>.

F — fetch GET and display

Task: Fetch JSON from restcountries and display each name in <ul id='list'>.

G — fetch POST

Task: On button click, POST {title, author} from two inputs to a Firebase URL.

H — Full mini-app (Lab Work 3 style)

Task: Inputs for project title, members, image URL. On Save: POST to Firebase. On load: GET and show all as Bootstrap cards.