Terms Flashcards
(128 cards)
What type of language is JavaScript?
It is a scripting language.
JavaScript is a scripting language. What is a scripting language?
A scripting language is a lightweight programming language.
What would be the result of the following code?
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
It will write what is between the <h1> and <p> tags to the browser screen formated accordingly to the respective HTML tags
What happens is you use:
document.write
After the document has loaded?
The whole document will be overwritten. Only use in the HTML output.
The alert() function is not much used in JavaScript, however it is useful for…?
It is often quite handy for trying out code.
What will this code do?
<p>
JavaScript can change the content of an HTML element.
</p>
It will change the text between the <p> tags to the content in quotes after x.innerHTML
Hello JavaScript!
This piece of code tells the computer to do what?
x=document.getElementById(“demo”);
Find the Element
(“demo”);
document.getElementById(“some id”)
The “Id” could be anything else.
This piece of code tells the computer to do what?
x.innerHTML=”Hello JavaScript!”;
Change the content of the x variable to Hello JavaScript!
What is the difference between JavaScript and Java ?
They are two completely different languages, in both concept and design.
Java (invented by Sun) is a more complex programming language in the same category as C.
What is the official name of the JavaScript standard ?
ECMA-262
Who invented JavaScript ?
Brendan Eich
In what year and what browser did JavaScript first appear ?
1995
In what year did the ECMA (a standard association) adopt JavaScript ?
1997
Who is the ECMA ?
European Computer Manufacturers Association
now the ECMA International
In an HTML document JavaScript must be placed between which tag ?
In what section of an HTML document can JavaScript be placed ?
The or the sections.
JavaScript can be placed in which part(s) of an HTML document ?
The or the sections.
It is common practice to place all JavaScript where in an HTML document ?
All in the section or at the end of the section, this way it is all in one place and does not interfere with the page content.
What does the following code do?
<!DOCTYPE html>
Links the “myScript.js” JavaScript file to the HTML document. Example of an External JavaScript file.
Is there something wrong with this file named:
myScript.js
External scripts cannot contain
What is JavaScript typically used for in regard to HTML documents ?
To manipulate HTML elements.
How do you access an HTML element from JavaScript
and what attribute do you use in the HTML?
To use the document.getElementById(“id”) method.
Use the id=” “ attribute to identify the HTML element:
JavaScript is a sequence of __________ to be executed by the browser.
statements
JavaScript statements are ________ to the browser.
commands