HTML written test front-end basic knowledge error prone questions knowledge points

Keywords: Javascript html css

Which of the following does not improve the efficiency of dom element operation:
Correct answer: D uses the event agent when handling the click event of the list sub element
When inserting a large number of DOM elements, use innerHTML instead of building elements one by one
Use DocumentFragment instead of multiple appendChild operations
Use addEventListener instead of onxxx (such as onclick) for event binding
answer:

Event agent is based on the principle of event bubbling. Using event agent can reduce registered events,Save memory
 Found after test innerHTML than creaetElement High efficiency~As for why....No deep study~
use DocumentFragment Replace multiple times appendChild operation // Inserting elements into code snippets at a time must be much more efficient than creating one at a time
 use addEventListener replace onxxx(such as onclick) Event binding // Using addEventListener to listen for events will not be overwritten, but on will overwrite the previous event

In the following code, the correct js code to set the red background for the div object with class test is ()

Correct answer: b your answer: B (correct)
document.getElementsByClassName("test").style.backgroundColor="red";
document.getElementsByClassName("test")[0].style.backgroundColor="red";
document.getElementsByClassName("test")[0].style.background-color="red";
document.getElementsByClassName("test").style.background-color="red";
answer:

stay js The attribute name added inside uses the hump method. In css In addition to using connecting wires id and query All other returns are node lists

Which of the following is true about the geolocation api in HTML5?

Correct answer: D your answer: D (correct)
A. The HTML5 geolocation API allows you to share your location with your favorite web sites

B. javascript can capture your latitude and longitude, and send it to the back-end Web server to do some strange location aware things, such as finding local enterprises or displaying your location on the map

C. Today, most browsers and mobile devices support geolocation API s

D. All of the above

answer:

Geolocation is HTML5 New in API Feature that allows JavaScript The program asks the browser for the user's real geographical location.
Some applications that identify geographical location can use it to display maps, navigation and other information related to the user's current location.
 Geolocation API Exist in navigator Object contains only 3 methods:
 1,getCurrentPosition //Current location.
 2,watchPosition //Monitor location.
 3,clearWatch //Clear monitoring
 ```HTML5 Geographic location API Allow you to interact with your favorite web Site share your location
 One javascript It can capture your latitude and longitude and send it to the back end Web Server, do some strange location aware things,
For example, find a local business or show your location on a map
 Today, most browsers and mobile devices support geolocation API

Which element does HTML5 not delete?

Correct answer: C
strike
center
small
big
answer:

When reviewing the knowledge points, just remember the following deleted labels:

<acronym>: Marked acronyms
<applet>: An embedded Java applet;That is, it can be parsed java of class An aspect of the document
<basefont>: This label defines the default font color, font size, and font family for all text in the document. reference resources: https://www.w3school.com.cn/tags/tag_basefont.asp
<big>: Make the text one size larger than the regular font
<center>: horizontally
<dir>: Paragraphs with right to left text orientation:<bdo dir="rtl">Text direction from right to left!</bdo>
<font>: Specify the size, font and color of the text
<frame>: <frameset>Elements are used to organize one or more<frame> element
<frameset>: HTML5 I won't support it<frameset>label
<noframes>: noframes Element can display text for browsers that do not support frames. noframes Element at frameset Inside the element. reference resources: https://www.w3school.com.cn/tags/tag_noframes.asp
<strike>: <strike>Labels can define strikethrough text definitions. reference resources: https://www.w3school.com.cn/tags/tag_strike.asp
<tt>: <tt>The label presents a text effect similar to a typewriter or equal width. reference resources: https://www.w3school.com.cn/tags/tag_tt.asp
 reference resources: https://jingyan.baidu.com/article/19192ad8c6ced1e53e57072d.html

Which input type is used to define week and year controls (no time zone)?

Correct answer: B
date
week
year
answer;

date Select day, month and year month Select month and year week Select week and year time Select time (hours and minutes)

The elements that belong to the semantics of HTML5 tags are ()
Correct answer: A D your answer: A D (correct)
article,footer
block
section,banner
header,nav
answer:

html5 Manual semantic label:
article
section
aside
hgroup
header
footer
nav
time
mark
figure
figcaption
contextmenu+menu
banner Not a semantic tag

You need to create a multi check box and associate it with the text (clicking the text is like clicking the check box). Which of the following HTML codes is correct? ()
Correct answer: A D your answer: A D (correct)

<label><input type="checkbox" />Remember me</label>
<input type="checkbox" /><label for="checkbox">Remember me</label>
<input type="checkbox" id="c1" /><label>Remember me</label>
<input type="checkbox" id="c1" /><label for="c1">Remember me</label

answer:

1. Wrapping with label can bind label to form elements;
2. The for attribute of label specifies which form element the label is bound to;

Which of the following elements bold text in the browser default style?
Correct answer: A D
h1
caption
em
th
answer:

Correct answer: A D
A: <h1> - <h6> Label representation HTML Title, bold by default
B: <caption> The label represents the table title, which is generally centered above the table, but not bold text
C: <em> Labels represent emphasis and are displayed in italics, but not bold text
D: <th> The label represents the header of the table. The default is bold text

The following are the events that will be triggered in Video/Audio?
Correct answer: B C D your answer: A B (wrong)
load
play
seeked
abort
answer:

method: load() play() pause()
event: play() playing() pause() seeked() seeking() abort()When audio/Triggered when the loading of the video has been abandoned

Posted by deemurphy on Sun, 24 Oct 2021 20:52:26 -0700