0% found this document useful (0 votes)
13 views

HTML_CSS3_JS_CH_02

Uploaded by

adilisdb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

HTML_CSS3_JS_CH_02

Uploaded by

adilisdb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Programming in HTML5 with JavaScript and CSS3

Chapter 02: Getting started with HTML5


Q1. HTML uses __________ to provide formatting features to content.
A. tag
B. attributes
C. statements
D. semantics
Answer: A
Q2. HTML originates from
A. XML
B. XHTML
C. SGML
D. RTF
Answer: C
Q3. _______ doesn’t have a defined set of tag names.
A. XHTML
B. HTML5
C. XML
D. XAML
Answer: C
Q4. Which one is an XML-based HTML specification that adhere to the XML rules of describing a
well-formed document?
A. HTML 4
B. HTML5
C. XHTML
D. CSS
Answer: C
Q5. HTML5 originates from
A. HTML 4.01
B. XHTML
C. SGML
D. CSS
Answer: A
Q6. Which one is not true about HTML5?
A. HTML5 can play audio and video and support animations from within the browser without
the need for plug-ins.
B. HTML5 contains most of the tags from HTML 4.01
C. HTML5 redefines some existing tags to be semantic tags
D. HTML5 does not introduce any new tag or attribute
Answer: D
Q7.How browsers are made forward compatible?
A. Browsers always have built-in feature to updates themselves with new standards.
B. Browsers always look for meaning from central repository if encounter new tags
C. Browsers always ignore tags that they don’t recognize
D. Browsers asks user to provide meanings for tags that they don’t recognize

1
Answer: C
Q8. Which one is XML-based specification of HTML and uses tighter rules to write well-formed
document?
A. HTML5
B. XHTML
C. XAML
D. JavaScript
Answer: B
Q9. What does Semantic means in the context of HTML?
A. tags provide look and feel to the content in the HTML document
B. tags provide meaning to the content in the HTML document
C. tags provide behavior to the content in the HTML document
D. All of the above
Answer: B
Q10. HTML tags provide a meaningful structure, but do not provide presentation.
A. True
B. False
Answer: A [Page 31]
Q11. What is the purpose of HTML in a web page?
A. providing a meaningful structure
B. providing presentation to the document
C. adding behavior to the document
D. making the document universal to the browser's
Answer: A
Q12. Where do you maintain the presentation of a HTML5 document?
A. In HTML file
B. In CSS3 stylesheet
C. In your JavaScript file
D. In style attribute of HTML elements
Answer: B
Q13. Where do you maintain the behavior of a HTML5 document?
A. In HTML file
B. In CSS3 stylesheet
C. In JavaScript file
D. In <script> elements
Answer: C
Q14. For what is the <area> element used?
A. To define a region in geolocation map
B. To define a region an article
C. To define an image map region
D. To create a hotspot in a page
Answer: C
Q15. For auxiliary sections you use
A. <div> tag
B. <section> tag
C. <aside> tag
D. <cite> tag
Answer: C
Q16. To create predefined control values, you use

2
A. <optgroup> tag
B. <option> tag
C. <datalist> tag
D. <datagrid> tag
Answer: C
Q17. To show an image with caption which HTML5 element do you use?
A. <img> and <span>
B. <img> and <caption>
C. <img> with title attribute
D. <figure>
Answer: D
Q18. Which tag should you use for providing alternative content for no script support?
A. <script>
B. <noscript>
C. <alt>
D. <content>
Answer: B
Q19. Which one is not a boolean attribute?
A. check
B. selected
C. readonly
D. src
Answer: D
Q20. Which of the following is not a valid way of adding checked attribute in an input box?
A. <input type="checkbox" name="fruit" value="Apple" checked />
B. <input type="checkbox" name="fruit" value="Apple" checked='' />
C. <input type="checkbox" name="fruit" value="Apple" checked='checked' />
D. <input type="checkbox" name="fruit" value="Apple">checked</input>
Answer: D
Q21. Which of the following is the preferred way of adding checked attribute in an input box?
A. <input type="checkbox" name="fruit" value="Apple" checked />
B. <input type="checkbox" name="fruit" value="Apple" checked='' />
C. <input type="checkbox" name="fruit" value="Apple" checked='checked' />
D. <input type="checkbox" name="fruit" value="Apple">checked</input>
Answer: C
Q22. Which attributes can be used in any HTML5 elements?
A. Global attributes
B. Expando attributes
C. Boolean attributes
D. style attribute
Answer: A
Q23. Author defined custom attributes are also known as _____________ attributes.
A. expando
B. extended
C. added
D. free
Answer: A
Q24. Which one is the best way to add custom attributes?
A. Prefix the attribute with “data-“

3
B. Prefix the attribute with “custom-“
C. Prefix the attribute with “-“
D. HTML4 or HTML5 does not allow custom attributes
Answer: A
Q25. You have a webpage with a <span> element that contains the customer’s name. Along with the
name, you want to include
the customer number on the <span> element, but you don’t want to display the customer number.
Which one accomplish it
correctly?
A. <span hidden-customerNumber='123'>Contoso Ltd</span>
B. <span data-customerNumber='123'>Contoso Ltd</span>
C. <span title='123'>Contoso Ltd</span>
D. <div><span id=’customerNumber’ style=’display:none;’>123</span><span>Contoso
Ltd</span></div>
Answer: B
Q25. Which browsers support conditional comments?
A. Internet explorer
B. Google chrome
C. Firefox
D. Safari
E. Opera
Answer: A [Only Internet Explorer recognizes conditional comments]
Q26. How do you ensure browsers are in no-quirks mode and operate in an HTML5-compliant
manner?
A. By adding a <!doctype> declaration at the top of the page
B. By eliminating browser implemented tags
C. By writing well-formed document
D. All of the above
Answer: A
Q27. What one the <title> element serve in web pages do not support?
A. Displays in the browser toolbar
B. Provides the default name for the page when it is added to favorites
C. Displays the title when a search engine displays the page in the search results
D. Contains short displayable contents
Answer: D
Q28. Which of the following is or are the valid way to display html entities?
A. &entity_name;
B. &#entity_number;
C. #entity_name;
D. #entity_number;
Answer: A, B
Q29. Which attribute is used to uniquely identify an element in a page?
A. name
B. id
C. class
D. Ref
Answer: B
Q30. Which attribute is used to provide inline style into an element?
A. id

4
B. class
C. style
D. css
Answer: C
Q31. Which one is not a void element?
A. link
B. br
C. hr
D. div
Answer: D
Q32. To insert a non-breaking space, you can use______
A. &space;
B. &br;
C. &nbsp;
D. &#nbsp;
Answer: C
Q33. How should you start each HTML5 document?
A. <html>
B. <head>
C. <title>
D. <!DOCTYPE html>
Answer: D
Q34. Browsers ignore tags that are not recognized.
A. True
B. False
Answer: A
Q35. Which element do you use to show a separate HTML document within a HTML document?
A. <emebed>
B. <object>
C. <iframe>
D. <document>
Answer: C
Q36. You are showing a different HTML pages within the current page and you want that embedded
page allow form, scripts but
still disabling plug-ins and pop-ups. Which one accomplishes this?
A. <iframe sandbox><iframe>
B. <iframe sandbox="allow-forms allow-scripts"
src="http://otherContent.com/content.html"></iframe>
C. <iframe allow-forms=’true’ allow-scripts=’true’
src="http://otherContent.com/content.html"></iframe>
D. <iframe froms scrpits src="http://otherContent.com/content.html"></iframe>
Answer: B
Q37. Which one create a email link?
A. <a href=”email:someone@shomwhere.com”> someone@shomwhere.com</a>
B. <a href=”mail:someone@shomwhere.com”> someone@shomwhere.com</a>
C. <a href=”mailto:someone@shomwhere.com”> someone@shomwhere.com</a>
D. <a href=”mail-to:someone@shomwhere.com”> someone@shomwhere.com</a>
Answer: D

5
Q39. you click a hyperlink to an external resource, the external resource opens in the current
browser window. How do you control this behavior?
A. By using the target attribute
B. By using the href attribute
C. By attaching a javascript click event handler
D. You cannot change this default behavior
Answer: A
Q40., Which one opens the target resource in a new browser window?
A. <a href=’target-url’>Target link</a>
B. <a href=’target-url’ target=’_self’>Target link</a>
C. <a href=’target-url’ target=’_blank’>Target link</a>
D. <a href=’target-url’ target=’_parent’>Target link</a>
Answer: C
Q41. Which target attribute value should you use to open hyperlinked document in parent frame or
window?
A. _parent
B. _top
C. _blank
D. _self
Answer: A
Q42. Which one is vector image format?
A. PNG
B. JPG
C. GIF
D. SVG
Answer: D
Q42. Which one supports animations?
A. PNG
B. JPG
C. GIF
D. SVG
Answer: C
Q43. How do you create a clickable image map in your HTML document?
A. Within the <img> element create a <map> with clickable region defined by <area> elements
B. Create a <map> with clickable region defined by <area> elements in it and set the usemap
attribute of the <img> element to the <map> element’s name
C. Create a <map> element and inside the <map> add clickable region defined by <area>
elements and add a <img> element
D. Create a image hyperlink and add javascript function to capture the coordinates of clicked
spot and identify region
Answer: B

You might also like