// 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
Automatic rotation, ajax and other main functions, followed by dom arrangement. Here we use the traditional tabs1 tabs2 hello world!
First, write a closure of the jquery plug-in. A friend in the garden wrote the closure concept of webpage
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
This is the folding menu effect code of the online help manual implemented by jquery.
; (Function ($ ){
Function load (settings, root, child, container ){$. GetJSON (settings. url, {root: root}, function (response ){Function createNode (parent ){Var
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
We will see that some websites have a small title or alt effect when we refer to the connection or image. Next I will introduce you to the quick implementation of beautiful webpage Title prompts using jquery, for more information, see.
The
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
ID is a unique id of some elements on the html page, including div, input, iframe, etc, the following describes how to use jquery to obtain the id value. For more information, see.
The Code is as follows:
Copy code
This article is a good jquery pop-up window effect code based on the jquery plug-in. For more information, see.
Function usage
$ ('Pop-Up button '). lee_dialog ({dialog: 'floating-layer object', close: 'close button '});
The Code is as
The element disappears because it is automatically hidden after I click it. Next I will introduce jquery to hide and display html elements. For more information, see.
This example shows how to make some elements disappear when you click the image
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
The common effect of downward expansion is very simple. You can simply use slideUp and slideDown. If the div to be expanded is absolutely positioned by position: absolute and relative to the bottom, for example, bottom: 0px, The slideDown is called
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.