JQuery gets the selected Text and Value of Select:Copy codeThe Code is as follows:Var checkText = jQuery ("# select_id"). find ("option: selected"). text (); // obtain the selected TextVar checkValue = jQuery ("# select_id"). val (); // obtain the
The problem I encountered is: the parameter content in the url contains & matches, and I have two solutions.One method is to use JS transcoding on the page., For example (frontend processing)Copy codeThe Code is as follows:$ {group.cn}) The second
Implementation Effect:As shown in, the created tab displays the corresponding content in the content area below when you move the cursor to a tag, and the color of the corresponding tab needs to be changed, as shown in, the current mouse position is
Copy codeThe Code is as follows:Var doc = invalid argument doc ument, input = doc. createElement ('input ');If (typeof input ['holder'] = 'undefined') // if the placeholder attribute is not supported{$ ('Input'). each (function (ele){Var me = $
1. Select checkbox list
:
Code:Copy codeThe Code is as follows: today's topic visual focus Finance auto Technology Real Estate Tourism2. Select checkbox table
:
Code:Copy codeThe Code is as follows: Category nameToday's topicVisual focusFinance
Copy codeThe Code is as follows:/*Drag process:1. Click the element to be dragged.2. The element under the click is selected and moved.3. When the mouse is up, stop the action.4. When you click the oDIV element, the oDIV area is available, and move
A problem occurs in the project. Under Firefox, $. getJSON (); The request data is normal, but in IE, $. getJSON (); only requests data once. The second request is not sent at all. It is known that it was captured by fiddler. If the second request
1,Window. onerrorEvent
The onerror event is used to help handle JavaScript errors on the page. When an exception occurs on the page, the error event is triggered on the window object. For example:
In this case, the browser displays the error
I attended a front-end interview yesterday, with an array of removing duplicates. The first thought was the method for storing key values in objects. The Code is as follows:Method 1: (simple key value storage) Copy codeThe Code is as follows:Array.
Adapted from php version, original:JQuery + PHP implement browsing more content http://www.helloweba.com/view-blog-130.htmlThe implementation in. net is recorded here.1. Create a database table test and insert some test data.:Copy codeThe Code is as
This kind of mall has a lot of online effects, but most of them are plug-ins, or JS is too complicated to write. It seems difficult for children's shoes to learn. This looks simple and easy to understand, please watch out for all your children's
First, copy the following code to an html file.Copy codeThe Code is as follows: rice eat Home back You band return to the top You can control the speed by yourself.
Jquery encapsulates some ajax request methods, which are very practical.
For example. AjaxComplete () -- when the request is complete. AjaxError () -- when the request fails. AjaxSend () -- append a function to execute the Ajax request.. AjaxStart ()
Js gets the current system time
Copy codeThe Code is as follows:Var myDate = new Date ();MyDate. getYear (); // obtain the current year (2 digits)MyDate. getFullYear (); // obtain the complete year (4 bits, 1970 -????)MyDate. getMonth (); // obtain
The function is very practical and the code is very simple
Result 1.
Result 2.
The style code is as follows:Copy codeThe Code is as follows:Body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, br, pre, form, fieldset, input, textarea, p,
There are three main methods
Conversion functions, forced type conversion, and weak type conversion using js variables.
1. conversion functions:
Js provides two conversion functions: parseInt () and parseFloat. The former converts the value to an
Comparison and logical operators are used to test true or false.
Comparison OperatorsComparison operators are used in logical statements to determine whether variables or values are equal.
Given x = 5, the following table explains the comparison
/*** This article simply sorts out the built-in methods of Array objects in W3C standards.* No nutrition is provided in the full text. However, some questions are raised during the final performance test.*/Mutator methods) These methods directly
Today, toggleClass () is a simple method to implement line-by-line color change: the code is as follows:Copy codeThe Code is as follows: line-by-line color change lanfeng frontend lanfeng frontend lanfeng frontend lanfeng frontend lanfeng
foothome foothome foothome foothome foothome www.jb51.net www.jb51.net www.jb51.net www.jb51.net www.jb51.net Home of foot > script home www.jb51.net www.jb51.net www.jb51.net www.jb51.net www.jb51.net Home of
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.