Use JavaScript to put the word "running" into #out.
Acceptance criteria
- 1.#out should show running.
JavaScript Tutorial · JavaScript Introduction
These 10 tasks go with the What is JavaScript chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “JavaScript is a programming language used to make web pages interactive and dynamic.” .
1.Make the page say somethingexercise · easy · 10 min
Use JavaScript to put the word "running" into #out.
Passes when: #out should show running.
2.Do a calculation in the pageexercise · easy · 10 min · practice plan
Work out 6 times 7 and show the result.
Passes when: #out should show forty-two.
3.Read something from the pageexercise · easy · 10 min · practice plan
Read the heading's text and show it.
Passes when: #out should show What is JavaScript.
4.Change a style from JavaScriptexercise · easy · 10 min · practice plan
Set #out's colour to red, then report "styled".
Passes when: #out should show styled.
5.Store and reuse a valueexercise · medium · 10 min · practice plan
Store a browser fact in a variable and show "dynamic".
Passes when: #out should show dynamic.
6.Fix the wrong selectorbug fix · easy · 8 min
The code targets an element that does not exist.
Passes when: #out should show running.
7.Fix the misspelled propertybug fix · easy · 8 min · practice plan
textContent is spelled wrong, so nothing appears.
Passes when: #out should show visible.
8.Fix the missing quotesbug fix · easy · 8 min · practice plan
The text is unquoted, so JavaScript looks for a variable.
Passes when: #out should show ready.
9.Fix the wrong method namebug fix · easy · 8 min · practice plan
querySelectorAll returns a list, not one element.
Passes when: #out should show single.
10.Fix the reversed assignmentbug fix · easy · 8 min · practice plan
The assignment is written backwards.
Passes when: #out should show assigned.
Between them these tasks cover Changing page content and Responding to input.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.