Learn about dom manipulation javascript tutorial, we have the largest and most updated dom manipulation javascript tutorial information on alibabacloud.com
Html dom tutorial 46-JavaScript Boolean object
A Boolean object is a basic data type of JavaScript.
A Boolean object is a Boolean object that packages a Boolean value.1: Boolean object Method
Method
Description
FF
N
IE
ToSource ()
Source code of the object
1
4
-
T
HTML Dom tutorial 48-javascript math object
Math objects are not classes of objects like date and string, so there is no constructor math (). functions like math. Sin () are just functions, not methods of an object. 1: Math object Method
Method
Description
FF
N
IE
ABS (X)
Absolute Value of the returned number
1
HTML Dom tutorial 45-javascript array object
1: array object Method
Method
Description
FF
N
IE
Concat ()
Concatenate two or more arrays and return results.
1
4
4
Join ()
Put all elements of the array into a string. The elements are separated by the specified delimiter.
1
3
4
elementElement.srcThe above method can be found to get some object properties and can be implemented using DOM Core or html_dom implementation, compared to the html_dom implementation is relatively short, but it can only be used to work with Web documents.3.css_domCss_dom is a CSS-based operation, in JavaScript in China, the main function of Css_dom technology is to get and set the various properties of th
// location.href = ' http://www.imdsx.cn ' // " Span style= "COLOR: #008000" > redirect Location.reload () // refresh location.href = Location.href // refresh TimerSetInterval (function, time)//set the timer to execute once every timeclearinterval (intervalobj)//Clear Timer functiontimeinterval () {varSetint = SetInterval (function() {Console.log (1); //execute once to end a scheduled taskclearinterval (Setint)},1000)} setTimeout (function, time)//set the timer, after the page lo
* Example:element.parentNode.setAttribute ("id", "Bannerul");3. Create a NodeCreateElement ()//Create an element with a label named TagNamecreateTextNode ()//Create a text node that contains textual textCreatedocumentfragment ()//Create Document fragmentation node* Example:document.createElement ("P");* Example:document.createTextNode ("Hellow World");* Document.createdocumentfragment () is to save the use of DOM. Each
property (Ie10 below) Add a method Add (Class1, Class2, ...) to add one or more class names to the element. Use the [JavaScript] view plain Copy to view the code slices on codes to derive to my Code slice document.getElementById ("id"). Classlist.add ("A", "B", "C" ) ); Added three classes to DOM object if you need to erase all of the original, re-add the method of using the assignment [
instances.Htmlcollection:getelementsbytagname,getelementsbyclassname,getelementsbytagnamens, Document.forms and so on are returning htmlcollection instances.NamedNodeMap: Represents a collection of attribute node objects, Ele.attributes returns NAMEDNODEMAP instancesQueries that run in real time when the DOM document is accessed, so the following code causes an infinite loop.var divs = document.getelementsbytagname (' div '), I,div; for (i = 0;i) {
first, the basic Operation
1.html ()
Use the HTML () method to read or set the InnerHTMLof the element.
is the equivalent of a innerhtml inside JavaScript.
2.text ()
Use the text () method to read or set the innertext of the element.
is the equivalent of a innertext inside JavaScript.
3.attr ()
Use the attr () method to read or set the attributes of an element, and to manipulate it with at
; Gets the state of the checkbox true to tick the action individual style style.xxx // Manipulating styles is more granular, manipulating individual style properties, or adding a style property to a label Style.backgroundcolor //Example: Styles in CSS can be connected through "-", in JavaScript, all "-" are removed, "-" capitalization Action property Note: CSS style with-, in JS need to-remove, at the same time will-the first letter in the back, su
jquery Gets the parent node, the sibling node, and inserts the content within the node.①$ ("#test1"). Parent ()//②$ ("#test1"). Next ()//Next node ③$ ("#test1"). Append (' Summary: At the time of writing JS, we must first determine whether the JavaScript or jquery, because the two different ways, the method name is not the same, can not be mixed.jquery DOM Element manip
Setting styles with DomElement.style.property = valueWhen to set a style with a DOM scriptThe author writes: The vast majority of modern browsers, although the support of the CSS pseudo-class is not very complete, but has good support for the DOM, so need to consider is the problem of the simplest solution is what, which solution will be more browser support.After trying the example of
, a complete JavaScript implementation was made up of three distinct parts
The Core (based on ECMAScript spec)
The Document Object Model (DOM)
The Browser Object Model (BOM)
ECMAScriptA Web browser is considered a host environment for ECMAScript, but it's not the only host environment. A List of other host environments listed here.Apart from
Dom Getting Started Tutorial: Properties and methods of DOM
Properties and methods define the DOM of the HTML of the programming interface.
Programming interfaceThe HTML of the DOM model as a set of node objects. Nodes can take advantage of
The Document Object model, Document Object Modeldom, is an API that interacts with JavaScript for content. JavaScript and Dom are often used as a whole, because JavaScript is usually for DOM manipulation and interaction. The main
I. OverviewStrings are almost ubiquitous in JavaScript, and when you are working with the user's input data, when you read or set the properties of a DOM object, while manipulating the cookie, there are of course more .... The core part of JavaScript provides a set of properties and methods for common string operations such as splitting strings, changing the case
HTML Dom tutorial 9-html Dom window object
1: Window object
Window objects are top-level objects in the Javascript level.
A window object represents a browser window or framework.
The window object is automatically created every time
2:
Set of window objects
Collection
Descr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.