: EQ (Index)An element that matches a given index valueIndex: Counting starting from 0$ ("UL Li:eq (3)")//element of index position 0 starts counting, so here's 3 actually for the 4th element$ ("ul"). Find ("Li"). EQ (3) //Using jquery Traversal method eq ()EQ (index|-index)get the first n ElementsIndexAn integer that
Cases
The code is as follows
Copy Code
JQuery set the radio value when you see someone using the Nth method
Using nth
The code is as follows
Copy Code
$ (' input:radio[name=sex]:nth (0) '). attr (' checked ', true);
In fact, Nth and EQ are the same, and can be replaced with EQ completely.
Using
For example:$ ("P" ).eq(0).css ("color") // because eq (num) returns a jq object, therefore, you can use the jq method css to get the color value of the first p tag using get:$ ("P "). get (0 ). style. color // because get (num) returns an html object, it is useless to use the traditional HTML object method. Of course, you can also get (num) and convert the object into the jq object before performing the op
Differences and usage of eq and get operations on jquery objects in jQuery -- a powerful tool for foreground display operations
: The eq () selector selects an element with the specified index value.
The index value starts from 0, and the index value of all the first element is 0 (not 1 ).
Get (index) gets a matching element. Index indicates the number of matched elements.
This allows you to select an actu
Definitions and usage
: the EQ () selector selects the element with the specified index value.
The index value starts at 0, and the index value of all the first elements is 0 (not 1).
Often used with other elements/selectors to select elements of a specific ordinal in a specified group, such as the example above.
The code is as follows
Copy Code
JQuery set the radio value when you see someone using the Nth me
As an example:
$ ("P"). EQ (0). CSS ("color")//Because EQ (num) Returns a JQ object, you can use the JQ method css to get the color value of the first P tag:
$ ("P"). Get (0). Style.color//Because getting (num) returns an HTML object, the JQ object is useless at this time using the traditional HTML object method. Of course, you can also convert objects to JQ objects after get (num):
$ ($ ("P"). Get (0)). CS
in HTML: id= "BTN", and then find this ID selector in the JS page: $ ("#btn"), and then perform an event operation on it.4. Class Selector: $ (". Btn")First declare a class selector in HTML: class= "BTN", then find this ID selector in the JS page: $ (". Btn"), and then perform an event operation on it.5. Tag Selector: $ ("tr")The tag selector is found in the JS page based on the label written in the HTML, such as TR, TD, and the event action on it.6, Parity selector: odd (even), even (odd) $ (
thinkphp template tags if and eq differences and comparison example analysis
The examples in this article describe the differences and comparisons between the thinkphp template label if and EQ. Share to everyone for your reference. The specific analysis is as follows:
In the TP template language. Both if and EQ can be used for comparison of variables. Summarize
Use the jquery traversal function-find (), EQ ()
I. BackgroundGets the value of a column when traversing the table.
ii. Examples and explanations
1) The main framework of HTML is as follows:
2) The effect diagram is shown as follows:
3) Gets the button value for the third row, fourth column. The code is as follows:
$ ("#table1"). Find ("tr"). EQ (2). FIND ("TD").
Multi-Yuan-intelligence-energy theory iq eq aq inverse business FQ Financial Business HQ Health Business BQ primary business CQ creation business mq d-Business qidr business MQ core business WQ zhishang sq lingshang
In the multi-element-intelligence-energy theory, human intelligence can be divided into at least eight categories:Language intelligence (verbal/linguistic)-The ability to effectively use languages and texts.Logical mathematical intelligen
If we want to input and print their own music notation, hands and no special notation software and special font, how to do? In fact, we can directly in the Word software through the EQ field code to make music notation, from a single melody to the voice of the Voice can be produced, copy, modify is also very convenient.
Start the EQ field and call out the notes.
"EQ
This article analyzes the use of the object traversal. eq (). first (). last (). slice () method in jQuery, as well as the differences between them, and the use of jQuery source code. Eq (index): extracts the index element from the set.
First (): returns the first element in the set.
. Last (): the last element in the protection set.
. Slice (start [, end]): returns the elements of the given range in the
This article mainly introduces the differences and comparison between the Thinkphp template Tag if and eq, and analyzes the differences between the Thinkphp template Tag if and eq for variable comparison, for more information about the Thinkphp template Tag if and eq, see the following example. Share it with you for your reference. The specific analysis is as fol
I believe most people will make mistakes in these two methods. You can view the API documentation carefully. EQ returns a jquery object, and get returns an array of HTML objects. For example:
Use EQ to obtain the color value of the first p Tag:
$("P "). EQ(0). CSS("Color") // because eq (Num) returns a JQ object, y
As shown below:
$ ('. a ')//Selected 3 A, are JQ objects (can be used JQ properties, methods)
$ ('. a '). EQ (1)//Select the second A, is the JQ object (Dom property method can not be used, the JQ properties, methods)
$ ('. a ') [1]//Selected the second A, is a DOM object (you can use the DOM property, method, you cannot use the JQ property method)
$ ('. a '). EQ (1) [0]//Select a second a,
Tags: operator ace error brings Roo company Operation RorWhen scripting is often written in operations, most people first think of using "-eq" for comparisons when using variables intermittently, but in fact if the variable value is null (NULL) for a special reason, bash shell converts null to 0 for "-eq" comparison, if you encounter this kind of confusion, you can change the integer comparison method to us
Introduction to Commands:Condition Judgment: If the user does not exist Add user, give password and display add success; otherwise Show if no already in, no add; Variable name:1 , can contain only letters, numbers, and underscores, and cannot begin with numbers;2 , should not be the same as the existing environment variables in the system;3 , it is best to see the name and know righteousness;Bash how to achieve the conditional judgment? Condition Test Type: integer test character Test file Test
Sometimes we have to enter some simple mathematical formula in Word, and the Equation Editor component is not installed in the system and can be entered in the EQ field.
Below, let's take an example of the formula for the input diagram to see the specific procedure: Place the cursor where you want to insert the formula, and then press the CTRL+F9 key combination to enter the field notation {}→ enter "EQ" i
EQ (Index): Extracts the elements in the collection that are indexed as index.First (): Returns an element in the collection.. Last (): Protect the final element in the collection.. Slice (Start[,end]): Returns the element of a given interval segment in the collection.First () and last () call EQ (), EQ () is implemented through slice (), slice () through. Pushst
Definition and usageThe eq () method reduces the number of elements that match a set by specifying an index.Syntax. Eq (index)Index:Integer, indicating the position of the element (minimum is 0 ).If it is a negative number, it is counted from the last element in the set.Detailed descriptionIf a jQuery object indicating a DOM element set is given, the. eq () metho
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.