Interview heavier basis!
a, html part:
Inline tags, block-level tags What? What is the difference between the two is? What are inline block elements?
html5 new semantic tags What?
b, CSS section:
Layout: position + flex
Gets the DOM element methods are there?
Block-level elements centered? Horizontal and vertical centered approach? Without knowing the element width and height of the situation, how to achieve horizontal and vertical center?
How to remove floating?
Box Model
Event delegates
c, JS part
Prototype and prototype chain
What Closures are, what are the disadvantages, advantages?
Value refers to the difference between an object reference? (Adding depth copy, how deep copy)
let, const, var difference
Some methods strings, arrays
Navigation attributes: parent, child nodes, sibling, etc.
d, database
连表语法:left join......on....、 right join......on....
Some good questions to answer:
1, jquery acquisition element method
Jquery method of obtaining two types of elements: jQuery selector, jQuery traversal functions.
1) get itself | 2) obtain the sibling elements | 3) obtain parent element | 4) obtain sub-elements |
1) get itself:
a.jQuery selector
Selector | Examples | Explanation |
#Id | $('#myId') | Selector ID: ID can be acquired as "myId" element, case sensitive |
.class | $('.myClass') | Selector class: class can be acquired as 'myClass' all the elements |
element | $('p') | Get all the <p> element |
:header | $(':header') | Get all the title elements: <h1> ~ <h6> |
:animated | $(':animated') | Get all the animation elements |
:contains(text) | $('p:contains(Hello)') | Get all contain text is case sensitive <p> element, the middle of the text Hello |
:hidden | $(':hidden') | Get all the hidden elements: width and height to 0, display: none, type = hidden, |
[attribute] | $('[href]') | Attribute selector: href attribute contains an overview of all the elements |
[attribute=value] | $('[href=a.html]') | A.html = Get all the elements with attributes href, and the value of ! = Get all elements with attributes href, and the value is not equal to the a.html = $ Get all properties with href, and the value at the end of the element a.html ^ = Get all elements with attributes href, and the value begins a.html = Get ~ all words "a.html" element with the attribute href, and the value comprising * = Href attribute with accessories, and the value contains the text "a.html" element |
:input | $(':input') | Get all input elements |
:radio | $(':radio') | All input elements with type = "radio" of There are similar: :text、:chexbox、:password、:submit、:reset、:button、:file |
:enabled | $(':enabled') | All enabled input elements. : Disabled and vice versa |
:checked | $(':checked') | All the selected input selection (radio buttons, check boxes) |
:gt(index) | $('p:gt(2)') | index starting from 0, obtain the index is greater than all <p> element 2 (not included) |
:lt(index) | $('p:lt(2)') | index starting from 0, obtain index is less than (not included) all <p> Elemental |
:even | $('tr:even') | All even <tr> element |
:odd | $('tr:odd') | All odd <tr> element |
b.jQuery selector jQuery traversal functions mixing
Selector | Examples | Explanation |
:first | $('p:first') | The first <p> element |
:last | $('p:last') | Finally, a <p> element |
:eq(index) | $("p:eq(1)") | The second <p> element, index starts from 0 |
c.jQuery traversal function
method | description |
eq() | Returns the number of elements with the specified index of the selected element |
first() | Returns the first element of the selected element |
last() | Returns the last element of the selected element |
2) Select the sibling elements
jQuery selector
$ ( 'div + p') of each next adjacent div <p> element
$ ( 'div ~ p') Get all <p> sibling elements with div
jQuery traversal function
next () returns after a sibling element of the selected element
nextAll () returns all sibling element after the element is chosen
PREV () Returns the previous sibling element of the selected element
prevAll () returns all of the selected elements with the previous level elements
3) obtain parent element
jQuery selector
$ ( "P: parent") get all the p elements of the parent element
jQuery traversal function
parent () Gets the selected elements of the parent element
parents () Gets the ancestor of all the elements of the selected element
4) acquisition sub-level elements
jQuery selector
$ ( 'div> p') div obtain all direct child elements <p> element
$ ( 'div p') that all progeny obtain div <p> element
jQuery traversal function
children () Returns all direct child elements of the selected element
Contents () Returns all direct child elements of the selected element (comprising text and annotation nodes)
Find () Returns the descendent elements of the selected element
2, bubbling, capture
https://blog.csdn.net/qq_34664239/article/details/82427549
3, how to stop bubbling
4, the conventional sorting algorithm
5, how to remove object attributes
element.removeAttribute () Removes the specified attribute from the element;
element.removeChild () is removed from the child node elements
6, FIG rotation native JS
7, VUE framework
8, the line written (8 + 2 selected programming)
1) bubble sort
2) continuously and the number of statistical and outputs the same character string, for example: aaabbccccbbba, output: 3a2b4c2b1a