JS All Functions Collection

Source: Internet
Author: User

The Lick () object. Click () causes the object to be clicked.

Closed object. Closed Object window is closed True/false

Cleartimeout (object) clears the SetTimeout object that has been set

Clearinterval (object) clears the SetInterval object that has been set

Confirm ("hint message") Popup confirmation box, OK return true cancel return False

Cursor: Style change mouse style hand crosshair text wait help default auto E/s/w/n-resize

Event.clientx returns the x-coordinate value of the last mouse click;

Event.clienty returns the last mouse-click y-coordinate value;

EVENT.OFFSETX returns the current mouse hover x coordinate value

Event.offsety returns the current mouse-hover y-coordinate value

document.write (document.lastmodified) page last update time

Document.ondblclick=x when double-clicking the mouse generates an event

Document.onmousedown=x Click mouse button to generate an event

Document.body.scrollTop; Returns and sets the coordinate value of the current vertical scroll bar, which must be mated with the function,

Document.body.scrollLeft; Returns and sets the coordinate value of the current horizontal scrolling service, which must be mated with the function,

Document.title document.title= "message"; Title bar text for the current window

Document.bgcolor document.bgcolor= "color value"; Change window background color

Document. Fgcolor document. fgcolor= "color value"; Change the body color

Document.linkcolor document.linkcolor= "color value"; Change the hyperlink color

Document.alinkcolor document.alinkcolor= "color value"; Change the color of the positive click Join

Document. Vlinkcolor document. vlinkcolor= "color value"; Change the color of an visited join

Document.forms.length returns the current page form singular

Document.anchors.length returns the number of anchor in the current page

Document.links.length returns the number of current page joins

Document.onmousedown=x Click the mouse to trigger the event

Document.ondblclick=x double-click Mouse Trigger Event

Defaultstatus Window.status=defaultstatus; Display the status bar settings by default

function function xx () {...} defining functions

IsNumeric Judging whether it is a number

InnerHTML xx= object. InnerHTML Enter the HTML source code in an OBJECT tag

InnerText Divid.innertext=xx will set the object value named for div positioning to XX

Location.reload (); Make this page refresh, target can be equal to a refreshed Web page

Math.random () random number of the number, can only be between 0 and 1, if you want to get the other number, can be *10, and then rounding

Math.floor (number) Converts an object number to an integer, rounding all decimals

Math.min back to which small

Math.max back to which big

Navigator.appname returns the current browser name

Navigator.appversion returns the current browser version number

Navigator.appcodename returns the current browser code name

Navigator.useragent returns the current browser user token

OnSubmit onsubmit= "return (XX ())" Using function return value

Opener Opener.document. Object control original Open Form object

Prompt Xx=window.prompt ("Prompt Information", "predetermined value"); Input statement

Parent parent. Frame name. Object Control Framework Page

Return return false Returns value

Random parameters (between 0 and 1)

Reset () Form.reset (); Reset the data in form form

Split ("") String.Split ("") separates string object Word utilises comma

Submit () Form object. Submit () Make the form object commit data

The CharAt (x) object of the String object returns the letter of the number of bits of the specified object

LastIndexOf ("string") right-to-left polling for the specified character, no return-1

IndexOf ("string") is consulted from left to right for the specified character, no return-1

toLowerCase () Convert all objects to lowercase

toUpperCase () Convert all objects to uppercase

SUBSTRING (0,5) string.substring (x,x) returns the characters from 0 to 5 in the object

SetTimeout ("function", time) sets a timeout object

SetInterval ("function", time) sets a timeout object

toLocaleString () x.tolocalestring () takes time from an X time object, exists as a string type

typeof (variable name) Check the type of the variable, the value is: string,boolean,object,function,underfined WINDOW.EVENT.BUTTON==1/2/3 the left mouse button equals 1 right key equals 22 keys pressed together as 3

Window.screen.availWidth returns the current screen width (blank space)

Window.screen.availHeight returns the current screen height (blank space)

Window.screen.width returns the current screen width (resolution value)

Window.screen.height returns the current screen height (resolution value)

Window.document.body.offsetHeight; Returns the current page height

Window.document.body.offsetWidth; Returns the current page width

Window.resizeto (0,0) Set the window to a wide height

Window.moveto (0,0) Move the window to a location

Window.focus () causes the current window to have focus

Window.Scroll (x, y) window scrollbar coordinates, Y-control moves up and down, must mate with function

window.open () window.open ("Address", "name", "Property") Properties: Toolbar (Toolbar), location (address bar), Directions,status (status bar), menubar (menu bar), ScrollBar (scroll bar), resizable (change size), Width (width), height (high), fullscreen (full screen), scrollbars (no scroll bar without parameters in full screen, Channelmode (widescreen), left ( open window x coordinate), Top (open window y coordinate)

window.location = ' View-source: ' + window.location.href Application Event View Web page source code;

A=new Date (); Create a for a new time object

Y=a.getyear (); The value of Y is the two-digit year from object A that gets the year value

Y1=a.getfullyear (); Get four-digit year of the year

M=a.getmonth (); Get month value

D=a.getdate (); Get Date value

D1=a.getday (); Gets the current week value

H=a.gethours (); Gets the current number of hours

M1=a.getminutes (); Gets the current number of minutes

S=a.getseconds (); Gets the current number of seconds

object. style.fontsize= "Text Size";

Unit:

mm/cm/in inch/pc/pt point/px pixel/em text high

1in=1.25cm

1pc=12pt

1PT=1.2PX (800*600 resolution)

Text Font properties:

FontSize size

Family fonts

Color colors

FontStyle style, value is normal, italic italic, oblique italic and bold

FontWeight, with values ranging from 100 to 900, 900 the most coarse, light,normal,bold

letterspacing spacing, change the distance between text, take value, 1pt,10px,1cm

TextDecoration: Text modification; value, none not decorated, underline underlined, overline underlined

Background: Text background color, backgroundimage: Background image, take value as the insertion path of the picture

Click the Web body function to invoke the trigger:

1.onClick when the object is clicked

2.onLoad when the Web page opens, can only be written in the body

3.onUnload when the page closes or leaves, it can only be written in body

4.onmouseover when the mouse hangs over it

5.onmouseout when the mouse leaves the object

6.onmouseup when Mouse is released

7.onmousedown when the mouse presses the key

8.onFocus when an object gets focus

9.onSelect when the text of an object is selected

10.onChange when the contents of the object are changed

11.onBlur when the object loses focus

Value returned when Onsubmit=return (SS ()) Table is monotonic

Straight border-bottom:1x solid Black

Dashed border-bottom:1x dotted black

Dot Dash border-bottom:2x dashed black

Double line border-bottom:5x Double black Groove border-bottom:1x groove Black

Ridge-shaped border-bottom:1x Ridge Black

1. Edge Highlight Glow (color= color, strength= brightness size)

JS Print plug-in common parameters

WEBBROWSER.EXECWB (*) Open

WEBBROWSER.EXECWB (2,1) Close all IE windows now and open a new window

WEBBROWSER.EXECWB (4,1) Save Web page

WEBBROWSER.EXECWB (6,1) printing

WEBBROWSER.EXECWB (7,1) Print preview

WEBBROWSER.EXECWB (8,1) print Page Setup

WEBBROWSER.EXECWB (10,1) view page Properties

WEBBROWSER.EXECWB (15,1) seems to be withdrawn, pending confirmation.

WEBBROWSER.EXECWB (17,1) Select all

WEBBROWSER.EXECWB (22,1) Refresh

WEBBROWSER.EXECWB (45,1) Close the form without prompting

JS All Functions Collection

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.