Saturday, April 28, 2018

JavaScript

2 JavaScript Quiz Test
JSONP







JavaScript Quiz Test


JavaScript Quiz Test

You can test your JavaScript skills with Omegas' Quiz.

The Test
The test contains 25 questions and there is no time limit.

The test is not official, it's just a nice way to see how much you know, or don't know, about JavaScript.

Count Your Score
You will get 1 point for each correct answer. At the end of the Quiz, your total score will be displayed. Maximum score is 25 points.

Start the Quiz
Good luck!

Start the Quiz
Omegas' Online Certification
The perfect solution for professionals who need to balance work, family, and career building.

More than 10 000 certificates already issued!

Get Your Certificate »

The HTML Certificate documents your knowledge of HTML.

The CSS Certificate documents your knowledge of advanced CSS.

The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.

The jQuery Certificate documents your knowledge of jQuery.

The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

The XML Certificate documents your knowledge of XML, XML DOM and XSLT.

The Bootstrap Certificate documents your knowledge of the Bootstrap framework.


JavaScript Browser Objects Examples


JavaScript Browser Objects Examples

Examples of using JavaScript to access and manipulate the Browser objects.

Window Object
Open a new window when clicking on a button
Open a new window and control its appearance
Blur and Focus a new window
Close the new window
Checks whether the new window has been closed or not
Write some text to the source (parent) window
Move the new window relative to its current position
Move the new window to the specified position
Print the current page
Resize a window by the specified pixels
Resize a window to a specified size
Scroll the content by the specified number of pixels
Scroll the content to a specified position
Window explained

Screen Object
The visitor's screen: Width
The visitor's screen: Height
The visitor's screen: Available Width
The visitor's screen: Available Height
The visitor's screen: Color Depth
The visitor's screen: Pixel Depth
Screen explained

Location Object
Return the hostname and port of the current URL
Return the entire URL of the current page
Return the path name of the current URL
Return the protocol portion of the current URL
Load a new document
Replace the current document
Break out of a frame

Location explained

History Object
Display the number of URLs in the history list
Create a back button on a page
Create a forward button on a page
Load a specific URL from the history list

History explained

Navigator Object
Is cookies enabled in the visitor's browser?
What is the name of the visitor's browser?
What is the engine name of the visitor's browser?
What is the version information of the visitor's browser?
What is user agent information of the visitor's browser?
What is the platform of the visitor's browser?
What is the language of the visitor's browser?
Is Java enabled in the visitor's browser?
Navigator explained

Popup Boxes
Display an alert box
Demonstrate line breaks in an alert box
Display a confirm box
Display a prompt box

Popup explained

Timing
Simple timing
Another simple timing
Timing event in an infinite loop
Timing event in an infinite loop - with a Stop button
A clock created with a timing event
Set and stop a timer with setInterval() and clearInterval()

Timing explained

Cookies
Create a welcome cookie
Cookies explained


JavaScript HTML DOM Events Examples


JavaScript HTML DOM Events Examples

Examples of using JavaScript to react to events

Input Events
onblur - When a user leaves an input field
onchange - When a user changes the content of an input field
onchange - When a user selects a dropdown value
onfocus - When an input field gets focus
onselect - When input text is selected
onsubmit - When a user clicks the submit button
onreset - When a user clicks the reset button
onkeydown - When a user is pressing/holding down a key
onkeypress - When a user is pressing/holding down a key
onkeyup - When the user releases a key
onkeyup - When the user releases a key
onkeydown vs onkeyup - Both
Mouse Events
onmouseover/onmouseout - When the mouse passes over an element
onmousedown/onmouseup - When pressing/releasing a mouse button
onmousedown - When mouse is clicked: Alert which element
onmousedown - When mouse is clicked: Alert which button
onmousemove/onmouseout - When moving the mouse pointer over/out of an image
onmouseover/onmouseout - When moving the mouse over/out of an image
onmouseover an image map
Click Events
Acting to the onclick event
onclick - When button is clicked
ondblclick - When a text is double-clicked
Load Events
onload - When the page has been loaded
onload - When an image has been loaded
onerror - When an error occurs when loading an image
onunload - When the browser closes the document
onresize - When the browser window is resized
Others
What is the keycode of the key pressed?
What are the coordinates of the cursor?
What are the coordinates of the cursor, relative to the screen?
Was the shift key pressed?
Which event type occurred?
Examples explained


JavaScript HTML Objects Examples


JavaScript HTML Objects Examples

Examples of using JavaScript to access and manipulate HTML objects.

Anchor Object
Find the value of the href attribute of a link
Find the value of the hreflang attribute of a link
Find the value of the id attribute a link
Find the value of the rel attribute of a link
Find the value of the target attribute of a link
Find the value of the type attribute of a link

Area Object
Find the alternate text of an image-map area
Find the coordinates of an area
Find the shape of an area
Find the href of an area
Find the protocol part of the href attribute of an area
Find the hostname part of the href attribute of an area
Find the port number part of the href attribute of an area
Find the pathname part of the href attribute of an area
Find the querystring part of the href attribute of an area
Find the hash part of the href attribute of an area
Find the value of the target attribute of an area

Base Object
Find the base URL for all relative URLs on a page
Find the base target for all links on a page

IFrame Object
Change the background color of an iframe
Find the height of an iframe
Find the value of the name attribute of an iframe
Find the source (src) attribute of an iframe
Change the source (src) attribute of an iframe

Image Object
Find the alternate text of an image
Find the height of an image
Click to display a high-resolution version of an image
Find the source (src) of an image
Change the source of an image
Change the source of the lightbulb
Find the value of the usemap attribute of an image
Table Objects
Change the width of a table border
Change the padding of a table
Find the innerHTML of a cell
Create a caption for a table
Delete rows in a table
Add rows to a table
Change the content of a table cell