Professional Documents
Culture Documents
:GENERAL
All javascript code should be placed in an external js file .
All css should be placed in an external css file .
:The click events of the buttons can be added in the html, for example
For example: an input button with the label "Set box color" that when clicked will call
.the "changeBoxColor" function
</ "()input type="button" value="Set box color" onclick="changeBoxColor>
I have attached the Help page that we covered yesterday to give you
an good reference for doing this exercise.(index.html+site.js + site.css)
.Please go over that "Help" example before starting the exercise
Instructions
:Create a web page that looks like that .1
The page will contain an input button with the label " Change Site .2
."background color
When clicking on the button, a prompt pop up will appear with the .3
:text
."Please enter the site back ground color" and with the default color of " yellow "
When the user enters a color and press ok, the site background color will
.be changed according the color that the user typed in the prompt
If the user enter "gray" color in the prompt message he will get an alert
saying:
" please choose another color" "
"Add an input text box. Give it id of "boxColor " and default value of "red .4
Add a div. Give it id of "box1" and inner text of "Box1".The div will have a .5
black border
Around it.(use external css file)
."Add an input button with label "Set box color .6
When the user clicks on that button, the box1 div background will be
:colored according the color in the boxColor text input. For example
":big"
When the user clicks on ok the " Set Box text " button, box1 div innerText
:will be changed according the text given in the prompt
The new spans or div will have an index inside it according its creation .10
index
!Good luck