JavaScript gets the current value of select to be worded:var value = document.getElementById ("select"). Options[document.getelementbyid ("select"). Options.selectedindex]. Valuevar text = document.getElementById ("select").
Screen the right key to the page or
Add background music to a Web pageIe:ns:*.MID MIDI format file for your background music
Automatically open and close windows
here is the connection
Let the browser fail while saving the page so that the
Today wrote a small hint of the success of the page, at the same time required to return to the previous page, and implementation of the previous page of the operation to refresh (such as deleted, added), the search on the internet, basically 90% is
You can turn the input method off in the page input control by setting Ime-mode
Want to close IME:
Want to use the current input method:
When a text field does not require Chinese input, we can reduce the likelihood of errors by setting the
This is the LGZX company's interview question, asks the JS string to add a method, removes the white space character (including Space, tab, page break, etc.) on both sides of the string.
Copy Code code as follows:
JavaScript can modify the parameters passed in the function, as follows
Copy Code code as follows:
function Func1 (name) {
name = ' Lily ';
alert (name);
}
Func1 (' Jack ');/output Lily
Look at one more example
The effect is not difficult, the point is the position and scale settings,
Capture mouse position, determine mouse position area, and onmouseover events, onmousemove events, onmouseout events
Set the scale to show the larger picture, the Chettu
1. Original value and reference value
The original value is stored in the stack, and the reference value is stored in the heap. such as program:
Copy Code code as follows:
function Person (id,name,age) {
This.id = ID;
THIS.name =
There are many ways to define functions in JavaScript, and the direct amount of the function is one of them. such as var fun = function () {}, where function does not assign value to fun then it is an anonymous function. OK, let's see how anonymous
1. The scope chain of JavaScript functions is defined as the scope chain and the run-time scope chain;
2. When the function is defined, it has an attribute [[scope]] that identifies its defined scope chain, and defines the scope chain [[scope]] to
Sometimes we jump to a page to finish the task, and then go back to the original page, which is seen in many download sites, to keep users.
This JavaScript-timed function is easy to implement.
Time set by Window.settimeout (code,time)//Code
When doing web development, we often use the page shutdown Event onbeforeunload, can give the user a choice to give up the opportunity to shut down, such as the blog editor. If the user chooses to leave, then the OnUnload event will naturally
In the JS ReadOnly property is strange, directly create an object, assign the object ReadOnly property can not be used in HTML as the following way:
Copy Code code as follows:
var x=document.createelement ("input");
X.type= "Text";
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