javascript指南_JavaScript的完整指南

javascript指南

In JavaScript, every function has a this reference automatically created when you declare it.

在JavaScript中,每个函数在声明它时都会自动创建一个this引用。

JavaScript's this is quite similar to a this reference in other class-based languages such as Java or C# (JavaScript is a prototype-based language and no “class” concept): It points to the which object is calling to the function (this object sometimes called as context). In JavaScript, however, the this reference inside functions can be bound to different objects depending on where the function is being called.

JavaScript的this类似于其他基于类的语言(例如Java或C#)中的this引用(JavaScript是基于原型的语言,没有“类”概念): 它指向哪个对象正在调用函数 (此对象有时称为上下文 )。 但是,在JavaScript中, this内部引用函数可以根据调用函数的位置绑定到不同的对象

Here are 5 basic rules for this binding in JavaScript:

以下是JavaScript中this绑定的5条基本规则:

规则1 (Rule 1)

When a function is called in the global scope, the this reference is by default bound to the global object (window in the browser, or global in Node.js). For example:

在全局范围内调用函数时,默认情况下, this引用绑定到全局对象 (浏览器中的window或Node.js中的global )。 例如:

function foo() {
  this.a = 2;
}

foo();
console.log(a); // 2

Note: If you declare the foo() function above in strict mode, then you call this function in global scope, this will be undefined and assignment this.a = 2 will throw Uncaught TypeError exception.

注意:如果您在严格模式下声明了上面的foo()函数,那么您将在全局范围内调用此函数, this将是undefined ,分配this.a = 2将引发Uncaught TypeError异常。

规则二 (Rule 2)

Let’s examine example below:

让我们来看下面的示例:

function foo() {
  this.a = 2;
}

const obj = {
  foo: foo
};

obj.foo();
console.log(obj.a); // 2

Clearly, in the above snippet, the foo() function is being called with context is obj object and this reference now is bound to obj. So when a function is called with a context object, the this reference will be bound to this object.

显然,在上面的代码片段中,使用Context对象是obj对象的foo()函数被调用,并且this引用现在绑定到obj 。 因此,当使用上下文对象调用函数时, this引用将绑定到该对象。

规则三 (Rule 3)

.call, .apply and .bind can all be used at the call site to explicitly bind this. Using .bind(this) is something you may see in quite a lot of React components.

.call.apply.bind都可以在调用点使用明确绑定this 。 您可以在很多React组件中看到使用.bind(this)的东西。

const foo = function() {
  console.log(this.bar)
}

foo.call({ bar: 1 }) // 1

Here’s a quick example of how each one is used to bind this:

这里的每个人是如何用来绑定一个简单的例子this

  • .call(): fn.call(thisObj, fnParam1, fnParam2)

    fn.call(thisObj, fnParam1, fnParam2) .call()fn.call(thisObj, fnParam1, fnParam2)

  • .apply(): fn.apply(thisObj, [fnParam1, fnParam2])

    .apply()fn.apply(thisObj, [fnParam1, fnParam2])

  • .bind(): const newFn = fn.bind(thisObj, fnParam1, fnParam2)

    .bind()const newFn = fn.bind(thisObj, fnParam1, fnParam2)

规则四 (Rule 4)

function Point2D(x, y) {
  this.x = x;
  this.y = y;
}

const p1 = new Point2D(1, 2);
console.log(p1.x); // 1
console.log(p1.y); // 2

The thing you must notice that is the Point2D function called with new keyword, and this reference is bound to p1 object. So when a function is called with new keyword, it will create a new object and this reference will be bound to this object.

您必须注意的是使用new关键字调用的Point2D函数,并且this引用绑定到p1对象。 因此,当使用new关键字调用函数时,它将创建一个新对象,并且this引用将绑定到该对象。

Note: As you call a function with new keyword, we also call it as constructor function.

注意:当您使用new关键字调用函数时,我们也将其称为构造函数

规则五 (Rule 5)

JavaScript determines the value of this at runtime, based on the current context. So this can sometimes point to something other than what you expect.

JavaScript确定的值this在运行时,基于所述当前上下文。 因此, this有时可能指向您期望之外的其他内容。

Consider this example of a Cat class with a method called makeSound(), following the pattern in Rule 4 (above) with a constructor function and the new keyword.

考虑这个Cat类的示例,该示例使用名为makeSound()的方法,遵循规则4(上)中的模式,并带有构造函数和new关键字。

const Cat = function(name, sound) {
  this.name = name;
  this.sound = sound;
  this.makeSound = function() {
    console.log( this.name + ' says: ' + this.sound );
  };
}

const kitty = new Cat('Fat Daddy', 'Mrrooowww');
kitty.makeSound(); // Fat Daddy says: Mrrooowww

Now let’s try to give the cat a way to annoy() people by repeating his sound 100 times, once every half second.

现在,让我们尝试通过每半秒钟重复100次发出声音来annoy()annoy()

const Cat = function(name, sound) {
  this.name = name;
  this.sound = sound;
  this.makeSound = function() {
    console.log( this.name + ' says: ' + this.sound );
  };
  this.annoy = function() {
    let count = 0, max = 100;
    const t = setInterval(function() {
      this.makeSound(); // <-- this line fails with `this.makeSound is not a function` 
      count++;
      if (count === max) {
        clearTimeout(t);
      }
    }, 500);
  };
}

const kitty = new Cat('Fat Daddy', 'Mrrooowww');
kitty.annoy();

That doesn’t work because inside the setInterval callback we’ve created a new context with global scope, so this no longer points to our kitty instance. In a web browser, this will instead point to the Window object, which doesn’t have a makeSound() method.

这并不工作,因为里面setInterval回调,我们已经创建了全球范围内新的上下文,因此this不再指向我们的猫咪实例。 在Web浏览器, this将改为指向窗口对象,该对象不具有makeSound()方法。

A couple of ways to make it work:

使其工作的几种方法:

  1. Before creating the new context, assign this to a local variable named me, or self, or whatever you want to call it, and use that variable inside the callback.

    创建新的上下文之前,分配this名为局部变量me ,或self ,或任何你想将它命名,并使用回调内部的变量。

const Cat = function(name, sound) {
  this.name = name;
  this.sound = sound;
  this.makeSound = function() {
    console.log( this.name + ' says: ' + this.sound );
  };
  this.annoy = function() {
    let count = 0, max = 100;
    const self = this;
    const t = setInterval(function() {
      self.makeSound();
      count++;
      if (count === max) {
        clearTimeout(t);
      }
    }, 500);
  };
}

const kitty = new Cat('Fat Daddy', 'Mrrooowww');
kitty.annoy();
  1. With ES6 you can avoid assigning this to a local variable by using an arrow function, which binds this to the context of the surrounding code where it’s defined.

    与ES6就可以避免分配this通过使用箭头功能,其结合本地变量this到它的限定的周围的代码的情况下。

const Cat = function(name, sound) {
  this.name = name;
  this.sound = sound;
  this.makeSound = function() {
    console.log( this.name + ' says: ' + this.sound );
  };
  this.annoy = function() {
    let count = 0, max = 100;
    const t = setInterval(() => {
      this.makeSound();
      count++;
      if (count === max) {
        clearTimeout(t);
      }
    }, 500);
  };
}

const kitty = new Cat('Fat Daddy', 'Mrrooowww');
kitty.annoy();

翻译自: https://www.freecodecamp.org/news/the-complete-guide-to-this-in-javascript/

javascript指南

JavaScript权威指南 犀牛书 Chapter 1. Introduction to JavaScript Section 1.1. JavaScript Myths Section 1.2. Versions of JavaScript Section 1.3. Client-Side JavaScript Section 1.4. JavaScript in Other Contexts Section 1.5. Client-Side JavaScript: Executable Content in Web Pages Section 1.6. Client-Side JavaScript Features Section 1.7. JavaScript Security Section 1.8. Example: Computing Loan Payments with JavaScript Section 1.9. Using the Rest of This Book Section 1.10. Exploring JavaScript Part I: Core JavaScript Chapter 2. Lexical Structure Section 2.1. Character Set Section 2.2. Case Sensitivity Section 2.3. Whitespace and Line Breaks Section 2.4. Optional Semicolons Section 2.5. Comments Section 2.6. Literals Section 2.7. Identifiers Section 2.8. Reserved Words Chapter 3. Data Types and Values Section 3.1. Numbers Section 3.2. Strings Section 3.3. Boolean Values Section 3.4. Functions Section 3.5. Objects Section 3.6. Arrays Section 3.7. null Section 3.8. undefined Section 3.9. The Date Object Section 3.10. Regular Expressions Section 3.11. Error Objects Section 3.12. Primitive Data Type Wrapper Objects Chapter 4. Variables Section 4.1. Variable Typing Section 4.2. Variable Declaration Section 4.3. Variable Scope Section 4.4. Primitive Types and Reference Types Section 4.5. Garbage Collection Section 4.6. Variables as Properties Section 4.7. Variable Scope Revisited Chapter 5. Expressions and Operators Section 5.1. Expressions Section 5.2. Operator Overview Section 5.3. Arithmetic Operators Section 5.4. Equality Operators Section 5.5. Relational Operators Section 5.6. String Operators Section 5.7. Logical Operators Section 5.8. Bitwise Operators Section 5.9. Assignment Operators Section 5.10. Miscellaneous Operators Chapter 6. Statements Section 6.1. Expression Statements Section 6.2. Compound Statements Section 6.3. if Section 6.4. else if Section 6.5. switch Section 6.6. while Section 6.7. do/while Section 6.8. for Section 6.9. for/in Section 6.10. Labels Section 6.11. break Section 6.12. continue Section 6.13. var Section 6.14. function Section 6.15. return Section 6.16. throw Section 6.17. try/catch/finally Section 6.18. with Section 6.19. The Empty Statement Section 6.20. Summary of JavaScript Statements Chapter 7. Functions Section 7.1. Defining and Invoking Functions Section 7.2. Functions as Data Section 7.3. Function Scope: The Call Object Section 7.4. Function Arguments: The Arguments Object Section 7.5. Function Properties and Methods Chapter 8. Objects Section 8.1. Objects and Properties Section 8.2. Constructors Section 8.3. Methods Section 8.4. Prototypes and Inheritance Section 8.5. Object-Oriented JavaScript Section 8.6. Objects as Associative Arrays Section 8.7. Object Properties and Methods Chapter 9. Arrays Section 9.1. Arrays and Array Elements Section 9.2. Array Methods Chapter 10. Pattern Matching with Regular Expressions Section 10.1. Defining Regular Expressions Section 10.2. String Methods for Pattern Matching Section 10.3. The RegExp Object Chapter 11. Further Topics in JavaScript Section 11.1. Data Type Conversion Section 11.2. By Value Versus by Reference Section 11.3. Garbage Collection Section 11.4. Lexical Scoping and Nested Functions Section 11.5. The Function( ) Constructor and Function Literals Section 11.6. Netscape's JavaScript 1.2 Incompatibilities Part II: Client-Side JavaScript Chapter 12. JavaScript in Web Browsers Section 12.1. The Web Browser Environment Section 12.2. Embedding JavaScript in HTML Section 12.3. Execution of JavaScript Programs Chapter 13. Windows and Frames Section 13.1. Window Overview Section 13.2. Simple Dialog Boxes Section 13.3. The Status Line Section 13.4. Timeouts and Intervals Section 13.5. Error Handling Section 13.6. The Navigator Object Section 13.7. The Screen Object Section 13.8. Window Control Methods Section 13.9. The Location Object Section 13.10. The History Object Section 13.11. Multiple Windows and Frames Chapter 14. The Document Object Section 14.1. Document Overview Section 14.2. Dynamically Generated Documents Section 14.3. Document Color Properties Section 14.4. Document Information Properties Section 14.5. Forms Section 14.6. Images Section 14.7. Links Section 14.8. Anchors Section 14.9. Applets Section 14.10. Embedded Data Chapter 15. Forms and Form Elements Section 15.1. The Form Object Section 15.2. Defining Form Elements Section 15.3. Scripting Form Elements Section 15.4. Form Verification Example Chapter 16. Scripting Cookies Section 16.1. An Overview of Cookies Section 16.2. Storing Cookies Section 16.3. Reading Cookies Section 16.4. Cookie Example Chapter 17. The Document Object Model Section 17.1. An Overview of the DOM Section 17.2. Using the Core DOM API Section 17.3. DOM Compatibility with Internet Explorer 4 Section 17.4. DOM Compatibility with Netscape 4 Section 17.5. Convenience Methods: The Traversal and Range APIs Chapter 18. Cascading Style Sheets and Dynamic HTML Section 18.1. Styles and Style Sheets with CSS Section 18.2. Element Positioning with CSS Section 18.3. Scripting Styles Section 18.4. DHTML in Fourth-Generation Browsers Section 18.5. Other DOM APIs for Styles and Style Sheets Chapter 19. Events and Event Handling Section 19.1. Basic Event Handling Section 19.2. Advanced Event Handling with DOM Level 2 Section 19.3. The Internet Explorer Event Model Section 19.4. The Netscape 4 Event Model Chapter 20. Compatibility Techniques Section 20.1. Platform and Browser Compatibility Section 20.2. Language Version Compatibility Section 20.3. Compatibility with Non-JavaScript Browsers Chapter 21. JavaScript Security Section 21.1. JavaScript and Security Section 21.2. Restricted Features Section 21.3. The Same-Origin Policy Section 21.4. Security Zones and Signed Scripts Chapter 22. Using Java with JavaScript Section 22.1. Scripting Java Applets Section 22.2. Using JavaScript from Java Section 22.3. Using Java Classes Directly Section 22.4. LiveConnect Data Types Section 22.5. LiveConnect Data Conversion Section 22.6. JavaScript Conversion of JavaObjects Section 22.7. Java-to-JavaScript Data Conversion Part III: Core JavaScript Reference Chapter 23. Core JavaScript Reference Sample Entry arguments[ ] Arguments Arguments.callee Arguments.length Array Array.concat( ) Array.join( ) Array.length Array.pop( ) Array.push( ) Array.reverse( ) Array.shift( ) Array.slice( ) Array.sort( ) Array.splice( ) Array.toLocaleString( ) Array.toString( ) Array.unshift( ) Boolean Boolean.toString( ) Boolean.valueOf( ) Date Date.getDate( ) Date.getDay( ) Date.getFullYear( ) Date.getHours( ) Date.getMilliseconds( ) Date.getMinutes( ) Date.getMonth( ) Date.getSeconds( ) Date.getTime( ) Date.getTimezoneOffset( ) Date.getUTCDate( ) Date.getUTCDay( ) Date.getUTCFullYear( ) Date.getUTCHours( ) Date.getUTCMilliseconds( ) Date.getUTCMinutes( ) Date.getUTCMonth( ) Date.getUTCSeconds( ) Date.getYear( ) Date.parse( ) Date.setDate( ) Date.setFullYear( ) Date.setHours( ) Date.setMilliseconds( ) Date.setMinutes( ) Date.setMonth( ) Date.setSeconds( ) Date.setTime( ) Date.setUTCDate( ) Date.setUTCFullYear( ) Date.setUTCHours( ) Date.setUTCMilliseconds( ) Date.setUTCMinutes( ) Date.setUTCMonth( ) Date.setUTCSeconds( ) Date.setYear( ) Date.toDateString( ) Date.toGMTString( ) Date.toLocaleDateString( ) Date.toLocaleString( ) Date.toLocaleTimeString( ) Date.toString( ) Date.toTimeString( ) Date.toUTCString( ) Date.UTC( ) Date.valueOf( ) decodeURI( ) decodeURIComponent( ) encodeURI( ) encodeURIComponent( ) Error Error.message Error.name Error.toString( ) escape( ) eval( ) EvalError Function Function.apply( ) Function.arguments[] Function.call( ) Function.caller Function.length Function.prototype Function.toString( ) Global Infinity isFinite( ) isNaN( ) Math Math.abs( ) Math.acos( ) Math.asin( ) Math.atan( ) Math.atan2( ) Math.ceil( ) Math.cos( ) Math.E Math.exp( ) Math.floor( ) Math.LN10 Math.LN2 Math.log( ) Math.LOG10E Math.LOG2E Math.max( ) Math.min( ) Math.PI Math.pow( ) Math.random( ) Math.round( ) Math.sin( ) Math.sqrt( ) Math.SQRT1_2 Math.SQRT2 Math.tan( ) NaN Number Number.MAX_VALUE Number.MIN_VALUE Number.NaN Number.NEGATIVE_INFINITY Number.POSITIVE_INFINITY Number.toExponential( ) Number.toFixed( ) Number.toLocaleString( ) Number.toPrecision( ) Number.toString( ) Number.valueOf( ) Object Object.constructor Object.hasOwnProperty( ) Object.isPrototypeOf( ) Object.propertyIsEnumerable( ) Object.toLocaleString( ) Object.toString( ) Object.valueOf( ) parseFloat( ) parseInt( ) RangeError ReferenceError RegExp RegExp.exec( ) RegExp.global RegExp.ignoreCase RegExp.lastIndex RegExp.source RegExp.test( ) RegExp.toString( ) String String.charAt( ) String.charCodeAt( ) String.concat( ) String.fromCharCode( ) String.indexOf( ) String.lastIndexOf( ) String.length String.localeCompare( ) String.match( ) String.replace( ) String.search( ) String.slice( ) String.split( ) String.substr( ) String.substring( ) String.toLocaleLowerCase( ) String.toLocaleUpperCase( ) String.toLowerCase( ) String.toString( ) String.toUpperCase( ) String.valueOf( ) SyntaxError TypeError undefined unescape( ) URIError Part IV: Client-Side JavaScript Reference Chapter 24. Client-Side JavaScript Reference Sample Entry Anchor Applet Area Button Button.onclick Checkbox Checkbox.onclick Document Document.all[] Document.captureEvents( ) Document.clear( ) Document.close( ) Document.cookie Document.domain Document.elementFromPoint( ) Document.getSelection( ) Document.handleEvent( ) Document.lastModified Document.links[] Document.open( ) Document.releaseEvents( ) Document.routeEvent( ) Document.URL Document.write( ) Document.writeln( ) Element Event FileUpload FileUpload.onchange Form Form.elements[] Form.onreset Form.onsubmit Form.reset( ) Form.submit( ) Form.target Frame getClass( ) Hidden History History.back( ) History.forward( ) History.go( ) HTMLElement HTMLElement.contains( ) HTMLElement.getAttribute( ) HTMLElement.handleEvent( ) HTMLElement.insertAdjacentHTML( ) HTMLElement.insertAdjacentText( ) HTMLElement.onclick HTMLElement.ondblclick HTMLElement.onhelp HTMLElement.onkeydown HTMLElement.onkeypress HTMLElement.onkeyup HTMLElement.onmousedown HTMLElement.onmousemove HTMLElement.onmouseout HTMLElement.onmouseover HTMLElement.onmouseup HTMLElement.removeAttribute( ) HTMLElement.scrollIntoView( ) HTMLElement.setAttribute( ) Image Image.onabort Image.onerror Image.onload Input Input.blur( ) Input.click( ) Input.focus( ) Input.name Input.onblur Input.onchange Input.onclick Input.onfocus Input.select( ) Input.type Input.value JavaArray JavaClass JavaObject JavaPackage JSObject JSObject.call( ) JSObject.eval( ) JSObject.getMember( ) JSObject.getSlot( ) JSObject.getWindow( ) JSObject.removeMember( ) JSObject.setMember( ) JSObject.setSlot( ) JSObject.toString( ) Layer Layer.captureEvents( ) Layer.handleEvent( ) Layer.load( ) Layer.moveAbove( ) Layer.moveBelow( ) Layer.moveBy( ) Layer.moveTo( ) Layer.moveToAbsolute( ) Layer.offset( ) Layer.releaseEvents( ) Layer.resizeBy( ) Layer.resizeTo( ) Layer.routeEvent( ) Link Link.onclick Link.onmouseout Link.onmouseover Link.target Location Location.reload( ) Location.replace( ) MimeType Navigator Navigator.javaEnabled( ) Navigator.plugins.refresh( ) Option Password Plugin Radio Radio.onclick Reset Reset.onclick Screen Select Select.onchange Select.options[] Style Submit Submit.onclick Text Text.onchange Textarea Textarea.onchange URL Window Window.alert( ) Window.back( ) Window.blur( ) Window.captureEvents( ) Window.clearInterval( ) Window.clearTimeout( ) Window.close( ) Window.confirm( ) Window.defaultStatus Window.focus( ) Window.forward( ) Window.handleEvent( ) Window.home( ) Window.moveBy( ) Window.moveTo( ) Window.name Window.navigate( ) Window.onblur Window.onerror Window.onfocus Window.onload Window.onmove Window.onresize Window.onunload Window.open( ) Window.print( ) Window.prompt( ) Window.releaseEvents( ) Window.resizeBy( ) Window.resizeTo( ) Window.routeEvent( ) Window.scroll( ) Window.scrollBy( ) Window.scrollTo( ) Window.setInterval( ) Window.setTimeout( ) Window.status Window.stop( ) Part V: W3C DOM Reference Chapter 25. W3C DOM Reference Sample Entry AbstractView AbstractView.getComputedStyle( ) Attr CDATASection CharacterData CharacterData.appendData( ) CharacterData.deleteData( ) CharacterData.insertData( ) CharacterData.replaceData( ) CharacterData.substringData( ) Comment Counter CSS2Properties CSSCharsetRule CSSFontFaceRule CSSImportRule CSSMediaRule CSSMediaRule.deleteRule( ) CSSMediaRule.insertRule( ) CSSPageRule CSSPrimitiveValue CSSPrimitiveValue.getCounterValue( ) CSSPrimitiveValue.getFloatValue( ) CSSPrimitiveValue.getRectValue( ) CSSPrimitiveValue.getRGBColorValue( ) CSSPrimitiveValue.getStringValue( ) CSSPrimitiveValue.setFloatValue( ) CSSPrimitiveValue.setStringValue( ) CSSRule CSSRuleList CSSRuleList.item( ) CSSStyleDeclaration CSSStyleDeclaration.getPropertyCSSValue( ) CSSStyleDeclaration.getPropertyPriority( ) CSSStyleDeclaration.getPropertyValue( ) CSSStyleDeclaration.item( ) CSSStyleDeclaration.removeProperty( ) CSSStyleDeclaration.setProperty( ) CSSStyleRule CSSStyleSheet CSSStyleSheet.deleteRule( ) CSSStyleSheet.insertRule( ) CSSUnknownRule CSSValue CSSValueList CSSValueList.item( ) Document Document.createAttribute( ) Document.createAttributeNS( ) Document.createCDATASection( ) Document.createComment( ) Document.createDocumentFragment( ) Document.createElement( ) Document.createElementNS( ) Document.createEntityReference( ) Document.createEvent( ) Document.createNodeIterator( ) Document.createProcessingInstruction( ) Document.createRange( ) Document.createTextNode( ) Document.createTreeWalker( ) Document.getElementById( ) Document.getElementsByTagName( ) Document.getElementsByTagNameNS( ) Document.getOverrideStyle( ) Document.importNode( ) DocumentCSS DocumentEvent DocumentFragment DocumentRange DocumentStyle DocumentTraversal DocumentType DocumentView DOMException DOMImplementation DOMImplementation.createCSSStyleSheet( ) DOMImplementation.createDocument( ) DOMImplementation.createDocumentType( ) DOMImplementation.createHTMLDocument( ) DOMImplementation.hasFeature( ) DOMImplementationCSS Element Element.getAttribute( ) Element.getAttributeNode( ) Element.getAttributeNodeNS( ) Element.getAttributeNS( ) Element.getElementsByTagName( ) Element.getElementsByTagNameNS( ) Element.hasAttribute( ) Element.hasAttributeNS( ) Element.removeAttribute( ) Element.removeAttributeNode( ) Element.removeAttributeNS( ) Element.setAttribute( ) Element.setAttributeNode( ) Element.setAttributeNodeNS( ) Element.setAttributeNS( ) ElementCSSInlineStyle Entity EntityReference Event Event.initEvent( ) Event.preventDefault( ) Event.stopPropagation( ) EventException EventListener EventTarget EventTarget.addEventListener( ) EventTarget.dispatchEvent( ) EventTarget.removeEventListener( ) HTMLAnchorElement HTMLAnchorElement.blur( ) HTMLAnchorElement.focus( ) HTMLBodyElement HTMLCollection HTMLCollection.item( ) HTMLCollection.namedItem( ) HTMLDocument HTMLDocument.close( ) HTMLDocument.getElementById( ) HTMLDocument.getElementsByName( ) HTMLDocument.open( ) HTMLDocument.write( ) HTMLDocument.writeln( ) HTMLDOMImplementation HTMLElement HTMLFormElement HTMLFormElement.reset( ) HTMLFormElement.submit( ) HTMLInputElement HTMLInputElement.blur( ) HTMLInputElement.click( ) HTMLInputElement.focus( ) HTMLInputElement.select( ) HTMLOptionElement HTMLSelectElement HTMLSelectElement.add( ) HTMLSelectElement.blur( ) HTMLSelectElement.focus( ) HTMLSelectElement.remove( ) HTMLTableCaptionElement HTMLTableCellElement HTMLTableColElement HTMLTableElement HTMLTableElement.createCaption( ) HTMLTableElement.createTFoot( ) HTMLTableElement.createTHead( ) HTMLTableElement.deleteCaption( ) HTMLTableElement.deleteRow( ) HTMLTableElement.deleteTFoot( ) HTMLTableElement.deleteTHead( ) HTMLTableElement.insertRow( ) HTMLTableRowElement HTMLTableRowElement.deleteCell( ) HTMLTableRowElement.insertCell( ) HTMLTableSectionElement HTMLTableSectionElement.deleteRow( ) HTMLTableSectionElement.insertRow( ) HTMLTextAreaElement HTMLTextAreaElement.blur( ) HTMLTextAreaElement.focus( ) HTMLTextAreaElement.select( ) LinkStyle MediaList MediaList.appendMedium( ) MediaList.deleteMedium( ) MediaList.item( ) MouseEvent MouseEvent.initMouseEvent( ) MutationEvent MutationEvent.initMutationEvent( ) NamedNodeMap NamedNodeMap.getNamedItem( ) NamedNodeMap.getNamedItemNS( ) NamedNodeMap.item( ) NamedNodeMap.removeNamedItem( ) NamedNodeMap.removeNamedItemNS( ) NamedNodeMap.setNamedItem( ) NamedNodeMap.setNamedItemNS( ) Node Node.appendChild( ) Node.cloneNode( ) Node.hasAttributes( ) Node.hasChildNodes( ) Node.insertBefore( ) Node.isSupported( ) Node.normalize( ) Node.removeChild( ) Node.replaceChild( ) NodeFilter NodeIterator NodeIterator.detach( ) NodeIterator.nextNode( ) NodeIterator.previousNode( ) NodeList NodeList.item( ) Notation ProcessingInstruction Range Range.cloneContents( ) Range.cloneRange( ) Range.collapse( ) Range.compareBoundaryPoints( ) Range.deleteContents( ) Range.detach( ) Range.extractContents( ) Range.insertNode( ) Range.selectNode( ) Range.selectNodeContents( ) Range.setEnd( ) Range.setEndAfter( ) Range.setEndBefore( ) Range.setStart( ) Range.setStartAfter( ) Range.setStartBefore( ) Range.surroundContents( ) Range.toString( ) RangeException Rect RGBColor StyleSheet StyleSheetList StyleSheetList.item( ) Text Text.splitText( ) TreeWalker TreeWalker.firstChild( ) TreeWalker.lastChild( ) TreeWalker.nextNode( ) TreeWalker.nextSibling( ) TreeWalker.parentNode( ) TreeWalker.previousNode( ) TreeWalker.previousSibling( ) UIEvent UIEvent.initUIEvent( ) ViewCSS Part VI: Class, Property, Method, and Event Handler Index Chapter 26. Class, Property, Method, and Event Handler Index Section 26.1. A Section 26.2. B Section 26.3. C Section 26.4. D Section 26.5. E Section 26.6. F Section 26.7. G Section 26.8. H Section 26.9. I Section 26.10. J Section 26.11. K Section 26.12. L Section 26.13. M Section 26.14. N Section 26.15. O Section 26.16. P Section 26.17. Q Section 26.18. R Section 26.19. S Section 26.20. T Section 26.21. U Section 26.22. V Section 26.23. W Section 26.24. X Section 26.25. Y Section 26.26. Z
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值