Implementation JavaScript Flashcards
What is ‘client-side’ scripting?
Client-side scripts are sections of code that are interpreted by the browser and executed on the client system.
Give a possible use for client-side scripting.
- To make web pages change once arriving at the browser.
- To validate data entered into a form by a client.
What is the primary use for JavaScript?
Changing the way a website interacts with a user as they navigate the site.
function mouseOver() {
document.getElementById(“demo”).style.color = “red”;
}
What will this code achieve once applied?
This function will change the style of an element to red when the mouse hovers over it, if the ID of that element is ‘demo’.
What tags must be used to implement JavaScript code, and where should they be located?
The ‘script’ tags must be used, and they function within the ‘head’ section.
What is a mouseOut() function?
A function used to change something, once the user removes their pointer from over it.
What action would trigger a mouseOver() event?
The user hovering over an element.
function zoomIn() { document.getElementById("question7").style.height="150px"; document.getElementById("question7").style.width="150px"; }
This function causes an image with the ID ‘question 7’ to change when hovered over. Using reference to the code above, how will the image change when this event takes place?
- It will change to a size of 150/150 px.
What kind of system interprets and runs client-side scripts?
Browser.
What use do IDs have in JavaScript code?
They allow you to select certain parts of a website to interact with.