("a")Gets a set of elements through the class name ClassName, but is supported only by newer browsers. Document.getelementsbyclassname ("Important Sale") Multiple class names are separated by spaces3. Get and Set propertiesObject.getattribute ("title"); Gets the title property of the objectObject.setattribute ("title", "a list of goods"); Sets the title property to a list of goods for object objectsNote: The properties that are set by setattribute are found and the modifications do not appear i
(condition)For loopfor (initial condition; test condition,; alter condition) {statements;}Six, functionDefines the syntax for a function:Function name (arguments) {statements;}Scope of the variableGlobal variables: can be referenced anywhere in the script. The scope is the entire script.Local variable: exists only inside the function that declares it.Global variables are masked when local variables declared in a function have the same name as global variables.Seven, ObjectAn object is a very im
handle keyboard events, and pressing any key on the keyboard triggers the onkeypress event. In some browsers, even the TAB key is included.In almost all browsers, using the TAB key to move to a link and press ENTER will also trigger the OnClick event.Five. DOM Core and Html-dom:1. Dom Core: Not specifically for JS, any programming language that supports the DOM can use them. The use is not limited to processing Web pages, they can be used to process
The onclick event, in fact, is not just a mouse click event, in fact, for users who use the keyboard can also trigger the event, such as the TAB key to move the connection, press the ENTER key can also trigger the OnClick eventSo in the actual code programming process, if you consider using the onkeypress event to be careful, this means that the user every press of a button will trigger it.When looking at this chapter of code optimization, I think tha
desirable values for the types of nodes, 3 of which have practical value: nodeType property: The type of the returned node; Node.nodetype (use this to verify that you have the node you want to Select)
The NodeType attribute value of the element node is 1
The NodeType property value of the attribute node is 2
The NodeType property value of the text node is 3
To change the value of a text node, you can use NodeValue Node.nodevalue= "description">Choose a imagep>Alert (descri
never be able to leave the current link.What about those people who use keyboards only?Fortunately, the OnClick event handler is smarter than we thought. Although its name "onclick" gives the impression that it is only associated with a mouse click action, it is not true: in almost all browsers, the action of tabbing to a link and pressing ENTER will also trigger the OnClick event.It is best not to use the OnKeyPress event handler function. The OnClick event handler function has been able to me
getElementsByTagNamedocument.getElementsByTagName ("Li"); // It returns an array of objects. var shopping = document.getElementById ("purchases"); var items = shopping.getelementsbytagname ("*"); alert (items.length); output:id The number of list items contained by an element with a property value of purchases GetelementsbyclassnameSet and get element properties GetAttributevar paras = document.getelementsbytagname ("P"); for (var i=0; i) { var title_text = Paras[i].getat
binary stream, then post to send, while Content-type is set to Form-data3.ajax process, Code:1 varXMLHTTP;2 //stationary degradation-object detection technology3 //1. Create an Object4 if(window. XMLHttpRequest) {5XMLHTTP =NewXMLHttpRequest ();//for ie7+, FireFox, Chrome, Safari, Opera6}Else{7XMLHTTP =NewActivexobjext ("Microsoft.XMLHTTP");//suitable for IE5, IE68 }9 //2. Determine the request type, send the requestTenXmlhttp.open ("GET", "ajax1.p
-A good example: I go to translate English, I am an interpreter. To interpret English as Chinese② Weak type-you do not have to explicitly declare the data type.**9. Basic idea: JS provides many built-in functions (such as alert,console, etc.), built-in objects (provided by the JS language itself, such as math, etc.), and host objects (provided by JS's running environment-browser, such as window, etc.). Custom functions and Object Services are also available. Angularjs also provides services suc
notation: if (222) {} Else if (111) {} Else if3. Small Knowledge Points:I is often used in the ①for cycle, the variable named I is a traditional practice: I means "increment" (increment)② can use ternary arithmetic to replace If-else, which makes the code brief, but the logical relationship is not obvious. With which, to see you in the mood③onclick event support for keyboard access has been good (PS: In all browsers, the TAB key is moved to a link,
Uiviewanimationoptiontransitionflipfrombottom//transitions, rotating from bottom to page
2.UIViewKeyframeAnimationOptions
Uiviewanimationoptionlayoutsubviews//Animate when layout child controls
Uiviewanimationoptionallowuserinteraction//Allow user interaction when animating
Uiviewanimationoptionbeginfromcurrentstate//Start animation from current state
Uiviewanimationoptionrepeat//Infinite repeat animations
Uiviewanimationoptionautoreverse//Perform animation loop
Uiviewanimation
JS + DOM programming art Reading Note 2Use of onclick
You can call return false to make it return invalid value. instance code:
Small details about nodevalueThe text under each label is not the nodevalue of the label.If you want to call the label text, use childnodes [0]The instance code is as follows:
There are no more valuable tags or function descriptions for this record.The main difference is thatS
Ref: The art of Multiprocessor Programming)
Note: I understand it as red (not sure it is correct) and it is black in reference books.
Last modification time: 09-16-2011
----------------------------------------------------------------------------------Time 2.1-A thread is a state machine and its state transition is called an event.-Events occur instantly. We assume that different events occur at different ti
This article mainly introduces the JavaScript Image Library of Reading Notes in JavaScriptDOM programming art. If you need it, you can refer to the following two methods to change the src attribute of the image:
1. The setAttribute method is an integral part of "level 1st DOM". It can be used to set any attribute of an element node.
2, element. src = source; this is the method before "level 1st DOM" appear
This article mainly introduces the DOM basis of reading notes in JavaScriptDOM programming Art. For more information, see
DOM
DOM: Document Object Model;
Node
Element node: DOM atoms are element nodes.,
,
And so on. An element can contain other elements. The only element that is not included in other elements isElement
Text node: In XHTML documents, text nodes are always contained in element nodes.
In the past few days, the weather in Hangzhou is getting colder and the body is getting more and more unable to withstand the cold impact. Today, we started a very early morning (), and we ran and exercised with our classmates. It's a good word!
I ran around 1500 meters. It was good at the beginning. I felt very hard when I got back. It may be the reason why I didn't exercise much during this time .. make up your mind to stick to it this winter. You can go swimming in the summer .. haha .. when
): O Perator needs one or both arguments> #乘法 > C (+) * C (3,4) [1] 3 8> #减法 > C (3,4)-C (+) [1] 2 2> #除法 > C ( 3,4)/C (on) [1] 3 2> #取余 > C (3,4) percent C (2,3) [1] 1 1>8. The most important and most common operator in the vector index R is the index, which is used to select the elements of a specific index in the directed amount to form a sub-vector. The format of the index vector is x[y] (x, y are vectors), which returns the result of those elements in X that are indexed as Y.R Language
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.