A group of unknown people hacked the HR Web Site
. They changed some of the content on the site.
While the security team is trying to find and eliminate the hacker code, your task is to restore the site to its previous state.
Unfortunately, any changes you make in the html
code have no effect. They may even destroy the original functionality of the site, so the only way to fix this is through writing your own code in the script.js
.
The hackers managed to deactivate the document.getElementById
, document.getElementsByTagName
, document.getElementsByClassName
, and document.getElementsByTagNameNS
, so the only way to modify the site is by changing the properties of the variables which contain a reference to html
elements.
- Manipulate the DOM.
- Access nested HTML objects in JavaScript.
-
Change the
placeholder
fromEnter bank account of hacker here
topossible number
by accessing the variablenumberInput
.- The input below the text
Input some text
has the placeholder textpossible number
.
- The input below the text
-
Change the button label from
Calculate the person with the highest hacking score
toCalculate highest salary
by accessing the variablecalculateHighestSalaries
.- The button under the five horizontal inputs has the label
Calculate highest salary
.
- The button under the five horizontal inputs has the label
-
Change the value of all salaries which have the value
-999999
to12823
by accessing thesalaryList
variable.- In table of the employees and salaries there are three rows with a value of
12823
.
- In table of the employees and salaries there are three rows with a value of
-
Change the button label from
Find all matching hackers
toFind all matching inputs
by accessing theemployeeList
variable. Make the design of the button similar to the rest of the buttons on the page.- The last button in the page has the label
Find all matching inputs
. - The last button in the page has the same look as the rest of the buttons in the page. (That is, blue background and white text.)
- The last button in the page has the label
-
Change all names in the last table from
Hacker n
to the values in theoriginalEmployeeData
list by accessing theemployeeList
variable.- The last table includes the names
John Smith
,Phyllis Duncan
,Alexandra Cummings
,Ruth Martin
,Charissa Kinney
,Jared Noel
,Mark Osborne
,Andrew Johnson
,Macy Masse
, andDavid Mcdonald
.
- The last table includes the names
-
Change the area that contains the words
Hackers to do not allow you to calculate the salaries anymore
to contain the HTML code fromindex.html
beneath thediv
withid=salariesInput
.- Under the
Calculate Net
button, there are five inputs and aSum salaries
button. - Clicking the
Sum salaries
button calls thesumSalaries
function, which displays the sum of the values from the previous inputs.
- Under the
None
- Add lots of HTML code at once by modifying the
innerHtml
property. - See all properties of a DOM object in the console by typing
console.dir(variableWhichContainsHtmlObject)
.
- JavaScript Tutorial For Beginners videos
- Article on "How to get started with web development"
- SoloLearn's JS tutorial
- javascript.info
- If you see yourself more as a cat person, do not miss JSForCats