IT Specialist HTML5 Application Development - INF-306 Exam Practice Test
You need to draw a blue rectangle that meets these conditions:
* It is 200 by 200 pixels.
* It contains a white circle that is centered within the rectangle.
* The circle has a 50-pixel radius.
* The image should appear as follows: a blue square with a centered white circle.
Refer to the image on the left.
You need to ensure that the image scales without distortion when the page is resized. You must not be required to use JavaScript.
Complete the code by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.

* It is 200 by 200 pixels.
* It contains a white circle that is centered within the rectangle.
* The circle has a 50-pixel radius.
* The image should appear as follows: a blue square with a centered white circle.
Refer to the image on the left.
You need to ensure that the image scales without distortion when the page is resized. You must not be required to use JavaScript.
Complete the code by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.

Correct Answer:

Explanation:
First blank: < svg width= " 200 " height= " 200 " >
Second blank: < rect width= " 200 " height= " 200 "
Third blank: < circle cx= " 100 " cy= " 100 " r= " 50 "
Fourth blank: < /svg >
The correct solution uses SVG because SVG graphics are vector-based and can scale without pixel distortion when the page or viewport changes. A < canvas > element would require script-based drawing logic, which violates the requirement that JavaScript must not be required. An < img > or < picture > element can display an image, but those options do not define the rectangle and circle directly in markup. The outer container must therefore be < svg width= " 200 " height= " 200 " > . The blue square is created with < rect width= " 200 " height= " 200 " fill= " blue " / > , which produces a rectangle matching the required 200-by-200 dimensions.
The centered white circle must use SVG circle geometry: cx= " 100 " and cy= " 100 " place the center at the midpoint of the 200-by-200 square, and r= " 50 " creates the required 50-pixel radius. The final closing tag must be < /svg > .
Which three events are valid for the HTML canvas element? Choose 3.
Correct Answer: B,C,E
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You need to display the following user interface:
Motorcycle
Truck
Boat
Car
Bicycle
Complete the markup by selecting the correct option from each drop-down list.

Motorcycle
Truck
Boat
Car
Bicycle
Complete the markup by selecting the correct option from each drop-down list.

Correct Answer:

Explanation:
First drop-down: datalist
Second drop-down: vehicles
Third drop-down: < /datalist >
The correct element is < datalist > because the interface requires a text input that provides selectable suggestions while still allowing the user to type. The < input > element uses list= " vehicles " , so it must be connected to a < datalist > element whose id is exactly vehicles. The id cannot be vehicle, because vehicle is already the input element's own identifier and does not match the value used by the list attribute. The < option
> elements inside the datalist define the suggested values: Motorcycle, Truck, Boat, Car, and Bicycle. ul, ol, and li are list-markup elements and do not create input suggestions. select would create a fixed dropdown list, but it would not match the editable input-with-suggestions behavior shown. The closing tag must match the opening datalist element, so the final selection is < /datalist > .
You need to create the layout shown, which defines five content areas:
* Logo and page title
* Menu
* Main content area
* Additional content area
* Copyright and contact information
You define the following classes:
* Logo and page title
* Menu
* Main content area
* Additional content area
* Copyright and contact information
You define the following classes:
Correct Answer: A
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You need to complete a postal code input form element (post_code). Include attributes to make the field mandatory, set the data type as text, and limit the input to five numeric digits.
Complete the code by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.

Complete the code by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.

Correct Answer:

Explanation:
First blank: type
Second blank: pattern
Third blank: required
The first blank must be type because the question requires the input data type to be text, producing type= " text " . The second blank must be pattern because [0-9]{5} is a regular expression that permits exactly five numeric digits. The third blank must be required because the postal code field must be mandatory before the form can be submitted.
You need to correctly apply a style rule for screen devices with a width of 480 pixels or less.
Complete the code by selecting the correct option from the drop-down list.

Complete the code by selecting the correct option from the drop-down list.

Correct Answer:

Explanation:
@media screen and (max-width: 480px) {
/* style rules go here */
}
The correct media query is @media screen and (max-width: 480px) {. The requirement says the style rule must apply to screen devices with a width of 480 pixels or less. In CSS media queries, screen identifies the media type, and (max-width: 480px) defines the upper viewport-width limit. This means the enclosed CSS rules apply when the viewport is 480 pixels wide or any smaller value, which is the standard mobile breakpoint behavior. @media screen and (width: 480px) is incorrect because it applies only when the viewport is exactly 480 pixels wide, not below it. @media screen display and (width: 480px) is invalid syntax because display is not used that way in a media query. @media screen-width: 480px is also invalid because it does not follow the required @media media-type and (feature: value) pattern. References/topics: responsive design, CSS media queries, @media, screen media type, max-width, mobile breakpoint styling.
You are creating a script that reads a JSON menu file and displays the Entree, Price, and Description.
Complete the code by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.

Complete the code by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct selection.

Correct Answer:

Explanation:
First drop-down: var xhr = new XMLHttpRequest();
Second drop-down: if(xhr.status===200){
Third drop-down: responseObject = JSON.parse(xhr.responseText);
The script must first create an XMLHttpRequest object, so the correct first selection is var xhr = new XMLHttpRequest();. This object performs the asynchronous request for menu.json. After the request finishes, the onload callback executes. The response should be processed only when the request succeeds, so the correct status check is if(xhr.status===200){; HTTP status 200 means the file was successfully retrieved.
Status codes 403, 404, and 500 represent forbidden access, missing resource, and server error conditions, so they are not appropriate for normal JSON processing. The JSON file is returned as plain text through xhr.
responseText, so it must be converted into a JavaScript object with JSON.parse(xhr.responseText). Once parsed, the code can access responseObject.menu[i].Entree, Price, and Description inside the loop and build the display output. responseXML is incorrect because the source file is JSON, not XML.