// 1. Obtain the selected option value$ ('# SelectList'). val ();// 2. Obtain the text of the selected option$ ('# SelectList: selected'). text ();// 3. Obtain multiple selected option values and textsVar foo = [];$ ('# Multiple: selected'). each
How to Use filter (), not (), split () find, and filter functions in jquery
Filter () and not ():
hello how are you? A new challenge is to select only one specific element from a group of similar or identical elements.Jquery provides filter ()
Form Validation)
JQuery Validation.Auto Help.Simple jQuery form validation.JQuery XAV-form validations.JQuery AlphaNumeric.Masked Input.TypeWatch Plugin.Text limiter for form fields.Ajax Username Check with jQuery.File upload)
Ajax File
1 I have been selected 2
You can also use alert ($ ("# sel option [@ selected]"). text () to query the content of the selected option ());
A little explanation:Select [@ name = 'sel '] option [@ selected] indicates the option element with the
In jquery, the select operation is much more convenient. If I want to obtain the selected select value, we can directly $ (\ '# s option: selected \'). val (). The following is a brief introduction to this topic.
Jquery obtains the selected text and
Radio Group radio is a common html control in html. Next I will introduce you to getting and setting the single-Choice Program code in jquery. For more information, see.
Radio Group radio: $ ("input [@ type = radio] [@ checked]"). val ();
Obtains
This article describes how to directly press Ctrl + Enter to submit the form implementation program after we Enter the content. This method is generally used in textarea. Other input fields are not required.
HTML
In the page body, we place a
There are many ways to get the value of a form element in jquery. I will introduce in detail the examples and methods for getting the value of a form element in jquery, for more information, see.
Such as html
The Code is as follows:
We will now see that many networks will have a fixed layer effect, that is, when we are not out of date, it will be displayed normally, otherwise it will scroll down with the mouse.
I will introduce you to several instances below
The Code
Jquery provides a lot of methods to obtain the element position. If we have methods such as position and offset, I will introduce you to the element position acquisition method example on the page.
Jquery provides two methods to obtain the element
We can use length to describe how to obtain the total number of elements in jquery.
In this example, the number (length) of the li element under id = "nav" UL is output)
The Code is as follows:
Copy code
untitled document
This article introduces the usage of getJSON () in jquery-json file content traversal and output methods. For more information, see.
In jquery, you can use the $. getJSON () method to load json files as needed. json files cannot be annotated, or
The following small series will introduce you to the implementation of clicking a table cell to achieve the input content and save the data to the database, the reason is that the click is to set the table content to pass to an input, when we leave,
The find () method is widely used for Traversing nodes. I will introduce some common examples of the find () method to help you.
First look at an example: Search for the descendant span element in all paragraphs and set its color to red. The Code is
Below I will introduce two regular expression examples for verifying the time format. This can actually be called js directly, because the Regular Expression Function jquery and js are the same. Let's look at the example below.
JQuery is used in the
Iframe operations have always been an interesting issue. I will often introduce you to using js to operate ifame, including passing values, taking values, and replacing src, next I will introduce jquery's iframe operation code.
Get the object in
In jquery, selector is a very important thing. The reason why jquery is so popular is that it plays a very important role. Next I will introduce the usage of jquery hierarchical selector.
1. find (): find the child and grandson elements of the
We will see that the advertisements of many websites do not scroll at the specified position, but will automatically scroll at the top or bottom of the browser when the position is exceeded. Next I will introduce an example for you.
The second-level
This article will give you a detailed introduction to the examples of multiple thumbnail-based scrolling plug-ins Based on jquery. I hope this method will be of great help to you.
Recently, I wrote a jquery plug-in for horizontal and vertical
Getting the image size in jquery is actually an application for obtaining the image height and width. We only need to use attr to load the ID. Here are two examples.
Example
The Code is as follows:
Copy code
Var
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.