Q. Which of these will properly access the value of a field called "City" on the form on a page:
- Some other silly suggestion
There are also a few that test whether or not you know the difference between "=" and "==". For example:
Q. In the following code the alert box always appears, which line will fix this?
var city = document.forms.City;
if (city.value = "London")
alert("I am in London")
- if (city.text = "London")
- if (city.value == "London")
- if (city == "London")
- if (city = "London")
- Explicitly declared, Loosely typed
- Implicitly declared, Loosely typed
- Explicitly declared, Strongly typed
- Implicitly declared, Strongly typed
- Contains the URL of a hypertext link
- Contained by the history object
- Contained by the document object
- Contains the URL of the current doc
var x = document.forms;
- The form object of the current page
- A document object with a form referrer
What does it do?
- Runs a global JS function called onClick()
- Runs onClick event of the onSubmit object
- Runs a JS function called onClick that is on a form object called submitMe
- Obviously wrong
onClick = "submitMe(this.form);"
- Call the function and pass form object of current page
- Call the function and pass form object of the current button object
- Belongs to window object
- Belongs to document object
- Belongs to location object
- Silly answer
- Access from a "popup" window back to the original using window.opener
- Linking from frame to another using things like window.top.frames.location...
- What characters get ignored ny JS => Tabs
If you do the exam then good luck. It's worth it alone just to put it on the resumé.......