How to get elements in JSTo get an element by an ID name:document.getElementById (' ID of element ')Events: Mouse events, keyboard events, system events, form events, custom events ....OnClick//Click eventsonmouseover//mouse move inonmouseout//Mouse awayONMOUSEDWN//Press to show something laterOnMouseUp///mouse raised an eventOnMouseMove//Stroke eventsHow to add an event:element. onmouseoverFunction: Can be understood as-command, do somethingFunction name () {//Definitely not active!Document get
the ES6 arrow function. Without a break statement, if you want to terminate prematurely, you must put the foreach () method in a try block and throw an exception.②map ()Passes each element of the called array to the specified function and returns an array that contains the return value of the function.Arr6_5_2 = [2, 4, 33, 111, 99, 66]; var arr6_5_3 = Arr6_5_2.map (function (x) {return 2*x}); Each value in the array is Console.log (Arr6_5_3); =>[4, 8, 66, 222, 198, 132]③filter ()Returns a sub
Use of regular expressions in JS
function Myvalid () {
var errormsg = "";
var res = true;
Get the value you want to validate.
var receivename = $ ("#receiveName"). Val ();//Name
var receivemobile = $ ("#tMobile"). Val ()/mobile number
var Validcode = $ ( "#validCode"). Val ()//Verification code
var regname =/^[\u4e00-\u9fa5]{2,4}$/;//authentication name
var regmobile =/^1[3|4|5|7|8][0-9]\ d{8}$/;//Verification Mobile phone
v
A view of the ASP's JavaScript program, convenient for everyone to learn ASP program (JS)
http://aspage.yeah.net/------------------------
--------------------from "rainbow drizzle"--------------------------------------------------
Program Author: Rainbow Rain chy.126.com
var autotop=new Array ()
Autotop[1]= ""
Autotop[2]= ""
Autotop[3]= ""
Autotop[4]= ""
Autotop[5]= ""
var autoend=new Array ()
Autoend[1]=
); Xhr.send (str); }node. JS:varHTTP = require (' http ');varQueryString = Require (' querystring '));varurl = require (' URL '));varUtil = require (' util ')); Http.createserver (function(req, res) {//Staging request body Information varBODY = ""; //Request LinkConsole.log (Req.url); //whenever the request body data is received, it is added to the postReq.on (' Data ',function(chunk) {body+ = chunk;//be sure to use + = if body=chunk, because the request favicon.ico,body will be equal 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.