Comparison of three methods of JS event binding
js incident
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body{
width:100%;
height:100%;
}
input{
display: block;
margin-bottom:10px;
}
.active{
...
Added by zohab on Fri, 07 Feb 2020 18:03:25 +0200
Getting nodes of getElement series and querySelector Series in JS DOM
Node lookup method
document.getElementById() must be preceded by document
document.getElementsByName() must be preceded by document
No restriction on elements before ele.getElementsByTagName()
No restriction on elements before ele.getElementsByClassName()
querySelector()
querySelectorAll()
. tagName element name
In the lower version of IE, t ...
Added by merrydown on Fri, 07 Feb 2020 17:36:14 +0200
The second week of winter vacation
Learn more about css this week:
Progress with learning video
Learning:
Three characteristics of css
Characteristic
Effect
Inheritance
Set some properties for the parent element, and the child element can also be used (only those starting with color,font-,text-,line can be inherited)
Stacking
...
Added by AngelGSD on Wed, 05 Feb 2020 12:28:32 +0200
JavaScript uses typeof to judge whether it is an object's disadvantage
Title: use typeof bar === "object" to determine whether bar is the potential trap of an object? How to avoid this trap?
1: Using typeof
First look at the following code:
var carr=[];
var cobj={};
function cfun(){
console.log('cc');
}
console.log(typeof carr=='object'); //true
console.log(typeof cobj==' ...
Added by andyjimmy on Sat, 01 Feb 2020 04:18:40 +0200
offsetWidth, clientWidth, innerWidth and related attribute methods in javascript
A series of properties and methods in js, such as offsetWidth, clientWidth and scrollWidth, are always confused. Here is a summary of the usage and meaning of these methods.
Note: the following element attributes and element methods are used in the way of elem. Attribute or elem. Method, window attribute is used in the way of ...
Added by dwardio on Sat, 01 Feb 2020 01:10:31 +0200
Several ways and differences of event binding
1. There are three common methods for event binding:
(1) Bind directly in DOM element
(2) Binding in js code;
(3) Binding event listener
Direct binding in DOM element:
<input type='button' onclick='fn()'>
<script>
function fn(){
console.log('hello');
}
&l ...
Added by moallam on Fri, 31 Jan 2020 10:58:17 +0200
1 magnifier effect (object oriented)
One.HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head> ...
Added by bladecatcher on Wed, 15 Jan 2020 12:58:26 +0200
Use Python to crawl 1000 posts of CET bar, they are all talking about these originally!
Write before
Postgraduate entrance examination means that if you want to know more about Postgraduate entrance examination, you can either go to your elder sister or go online to search for it. Posting is a good place.With powerful tools, valuable information can be quickly obtained from the mixed information of fishes and dragons on the web.Al ...
Added by sapoxgn on Tue, 14 Jan 2020 18:43:20 +0200
On the method of centering text and box in css
Copyright notice: This is the original article of the blogger. If there is any error in the article, please contact the blogger to correct it. Please don't leave a malicious message (please detour if you don't like it). You are welcome to reprint. Please indicate the original address when reprinting: https://blog.csdn.net/qq_3 ...
Added by nikkieijpen on Sat, 04 Jan 2020 22:29:49 +0200
text(),html() and val() in jQuery
text()
This method sets or returns the text content of the selected element
example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
& ...
Added by jpbox on Thu, 02 Jan 2020 17:04:30 +0200