_
The pseudo-class concept is introduced to permit selection based on information that lies outside of the document tree or that cannot be expressed using the other simple selectors.
Pseudo-elements create abstractions about the document tree beyond those specified by the document language. For instance, document languages do not offer mechanisms to access the first letter or first line of an element's content. Pseudo-elements allow authors to refer to this otherwise inaccessible information. Pseudo-elements may also provide authors a way to refer to content that does not exist in the source document (e.g., the ::before and ::after pseudo-elements give access to generated content).
- 抛弃table布局
- 使用label标签并和输入控件关联
// 方式1 利用for属性 <input type="checkbox" id="keepSigned" name="keepSigned" value="" /> <label for="keepSigned">Keep Me Signed.</label> // 方式2 将输入控件作为label的子元素 <label> <input type="checkbox" id="keepSigned" name="keepSigned" value="" />
一、利用ES6 Set去重(ES6中最常用)
function unique (arr) {
return Array.from(new Set(arr)); // 或着利用扩展运算符 return [...new Set(arr)];
}
var arr = [1,1,'true','true',true,true,15,15,false,false, undefined,undefined, null,null, NaN, NaN,'NaN', 0, 0, 'a', 'a',{},{}];
console.log(unique(arr))
//[1, "true", true, 15, false, undefined, null, NaN, "NaN", 0, "a", {}, {}]
_
_
JSON.stringify([1,2,3].sort()) === JSON.stringify([3,2,1].sort()); //true
或者
[1,2,3].sort().toString() === [3,2,1].sort().toString(); //true