Onbeforeunload is also called when the page is refreshed or closed. onbeforeunload is called when the server is about to read a new page. At this time, it has not started reading; onUnload has read the new page to be loaded from the server and is
CopyCode The Code is as follows:
first option
second option
third option
your browser can't handle this script
Use the following code to access the options in the drop-down list:Copy codeThe Code is as follows: // get the option
Practice:
Modify the outerhtml of input;
Example:
CopyCodeThe Code is as follows: function resetinput ()
{
VaR controls = Document. getelementsbytagname ('input ');
For (VAR I = 0; I If (controls [I]. type = 'text ')
{
If (controls [I].
For example, there is a string xtxtxt 1221 , I want to find out the ALT value and the non-tag value. In this example, I want to search for the result 123xtxtxt3211221yes. Another point is that the original string is uncertain, is input by the user
I just learned how to operate the DOM node tree and its attributes. while trying to write an example that does not need to manually set the ID and double-click the event, after a long time, I finally got an example,
Code(Note: double-click the code
Tabindex is easy to use. It uses the tab key to traverse the form elements and links of the page and determine the order according to the size of tabindex. Although it is insignificant, it is really hard to understand the details. This is the
Use Regexp's explicit constructor. Syntax: New Regexp ("pattern" [, "Flags"]).
Use Regexp's implicit constructor in plain text format:/pattern/[flags].
The pattern part is required for the regular expression pattern text to be used. In the first
Html
Code :
Copy code The Code is as follows:
untitled document
Username:
password:
JS Code:Copy codeThe Code is as follows: Function setcookie (name, value, expires, path, domain, secure ){VaR curcookie = Name + "=" +
Httml
Code :
Copy code The Code is as follows:
untitled document
website1
website2
website3
website4
remember my selections
JS Code: Copy code The Code is as follows:
Today, I encountered a very interesting problem. Because the company has cooperated with some vendors to close the issue, the websites of both parties will also exchange links. When the contract ends today, however, when the other party never links
Section 1CodeIs to use global variables to obtain the Real-Time mouse position.
Copy code The Code is as follows: var xpos;
VaR ypos;
Specified parameter Doc ument. onmousemove (function (EVT ){
EVT = EVT | window. event;
If (EVT. pagex ){
Xpos =
The author sends a picture, which can be enlarged.
The literal syntax problem about JavaScript was mentioned a few days ago and it was quite interesting. So I studied it again. Can I convert the object into the literal form? Just like what we
Xmlns = "http://www.w3.org/1999/xhtml">
Select a city
[Cancel] [OK] Layer 3Layer 3Layer 3Layer 3 Beijing Fujian Sichuan Jiangsu Shanghai Yunnan Guizhou Heilongjiang Jilin Province Liaoning USA Afghanistan The city you
JavaScript does not have private and public access permission setting keywords. However, you can use certain techniques to simulate the same results.
First, let's look at the following line
Code :
VaR I = (1, 2, 3, 4, 5 );
The final result of
Before talking about the above concepts, we should first talk about the implicit parameter of the function in javascript: arguments
Arguments
This object represents the function being executed and the parameters of the function that calls it.
Undoubtedly, importing a new style sheet directly is the best option based on the separation of presentation and structure, but in some cases it won't work. For example, if we make a div that can be dragged, from the perspective of setting a style,
1, cannot be blank
2. Only English and numbers can be entered.
3. The judgment character consists of letters, numbers, underscores, and periods. It must start with an underscore or letter. /^ ([A-Za-Z _] {1}) ([\ W] *) $/g. Test (STR)
4. Only
(10) addEvent
The most popular version on the internet is Scott Andrew. It is said that the javascript community held a competition (this event can be seen on Pro Javascript Techniques page 100th) or browsed the PPK website, ask for the function to
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service