Javascript event list

Source: Internet
Author: User

Javascript event list explanation
Event Browser support Explanation
General events Onclick Ie3, N2 This event is triggered when you click the mouse.
Ondblclick Ie4, N4 This event is triggered when you double-click the mouse.
Onmousedown Ie4, N4 Trigger this event when you press the mouse
Onmouseup Ie4, N4 This event is triggered when you press the mouse and release the mouse.
Onmouseover Ie3, N2 This event is triggered when you move the cursor over an object range.
Onmousemove Ie4, N4 This event is triggered when you move the mouse.
Onmouseout Ie4, N3 This event is triggered when the mouse leaves an object range.
Onkeypress Ie4, N4 This event is triggered when a key on the keyboard is pressed and released.
Onkeydown Ie4, N4 This event is triggered when a button on the keyboard is pressed
Onkeyup Ie4, N4 This event is triggered when a button on the keyboard is pressed and opened
Page related events Onabort Ie4, N3 The image is interrupted by the user during download.
Onbeforeunload Ie4, n This event is triggered when the content of the current page is about to be changed
Onerror Ie4, N3 This event is triggered when an error occurs.
Onload Ie3, N2 This event is triggered when the page content is complete.
Onmove IE, N4 This event is triggered when the browser window is moved.
Onresize Ie4, N4 This event is triggered when the browser window size is changed
Onscroll Ie4, n This event is triggered when the browser's scroll bar position changes.
Onstop Ie5, n This event is triggered when the stop button of the browser is pressed or the file being downloaded is interrupted.
OnUnload Ie3, N2 This event is triggered when the current page is changed
Form-related events Onblur Ie3, N2 This event is triggered when the current element loses focus.
Onchange Ie3, N2 This event is triggered when the current element loses focus and the element content changes.
Onfocus Ie3, N2 This event is triggered when an element gets focus
Onreset Ie4, N3 This event is triggered when the reset attribute in the form is fired.
Onsubmit Ie3, N2 This event is triggered when a form is submitted.
Rolling subtitle events Onbounce Ie4, n This event is triggered when content in marquee is moved out of the marquee display range.
Onfinish Ie4, n This event is triggered when the marquee element completes the content to be displayed.
Onstart Ie4, n This event is triggered when the marquee element begins to display content
Edit event Onbeforecopy Ie5, n This event is triggered when the selected content on the page is to be copied to the viewer's clipboard.
Onbeforecut Ie5, n This event is triggered when part or all of the content on the page is removed from the current page [clipboard] and moved to the browser's system clipboard.
Onbeforeeditfocus Ie5, n The current element is about to enter the editing status.
Onbeforepaste Ie5, n This event is triggered when the content is to be transferred [pasted] to the page from the browser's system clipboard
Onbeforeupdate Ie5, n The target object is notified when the viewer pastes the content in the system clipboard.
Oncontextmenu Ie5, n Events that are triggered when a viewer presses the right-click button to display a menu or triggers a page menu by pressing the keyboard.
Oncopy Ie5, n This event is triggered when the selected content on the page is copied.
Oncut Ie5, n This event is triggered when the selected content on the page is cut
Ondrag Ie5, n This event [activity event] is triggered when an object is dragged.
Ondragdrop IE, N4 An external object is dragged to the current window or frame by the mouse
Ondragend Ie5, n This event is triggered when the mouse drag ends, that is, the mouse button is released
Ondragenter Ie5, n This event is triggered when an object that is dragged by the mouse enters its container range.
Ondragleave Ie5, n This event is triggered when an object that is dragged by the mouse leaves its container range.
Ondragover Ie5, n This event is triggered when a dragged object is dragged within the range of another object container.
Ondragstart Ie4, n This event is triggered when an object is dragged.
Ondrop Ie5, n This event is triggered when the mouse key is released during a drag process.
Onlosecapture Ie5, n This event is triggered when an element loses the focus of selection formed by moving the mouse.
Onpaste Ie5, n This event is triggered when the content is pasted
Onselect Ie4, n Event when text content is selected
Onselectstart Ie4, n Event triggered when the text content is selected
Data Binding Onafterupdate Ie4, n This event is triggered when data is transferred from the data source to the object.
Oncellchange Ie5, n When the data source changes
Ondataavailable Ie4, n Event triggered when data reception is complete
Ondatasetchanged Ie4, n Events triggered when data sources change
Ondatasetcomplete Ie4, n This event is triggered when all valid data of the Child data source is read.
Onerrorupdate Ie4, n When the onbeforeupdate event is used to trigger the cancellation of data transfer, the onafterupdate event is replaced
Onrowenter Ie5, n Events triggered when the data in the current data source changes and new valid data exists
Onrowexit Ie5, n Event triggered when the data of the current data source is about to change
Onrowsdelete Ie5, n This event is triggered when the current data record is deleted.
Onrowsinserted Ie5, n This event is triggered when the current data source is about to insert a new data record
External events Onafterprint Ie5, n This event is triggered when the document is printed
Onbeforeprint Ie5, n This event is triggered when the document is about to be printed
Onfilterchange Ie4, n Events triggered when the filter effect of an object changes
Onhelp Ie4, n This event is triggered when the viewer presses F1 or the browser's help selection.
Onpropertychange Ie5, n This event is triggered when one of the object attributes changes.
Onreadystatechange Ie4, n This event is triggered when the object's initialization property value changes.

 

 

 

Javascript Event Query synthesis (transfer)
Javascript Event Query Synthesis
Click () object. Click () enables the object to be clicked.
Whether the closed object window has been closed; true/false
Cleartimeout (object) clears the set setTimeout object
Clearinterval (object) clears the set setinterval object
The confirm ("prompt message") dialog box is displayed. Confirm to return true. Cancel to 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 clicked;
Event. clienty returns the last mouse y coordinate value;
Event. offsetx returns the X coordinate value of the current mouse hover.
Event. offsety returns the Y coordinate value of the current mouse hover.

Document. Write (document. lastmodified) Last Update Time of the webpage
Document. ondblclick = x: an event occurs when you double-click the mouse.
Document. onmousedown = x click the mouse key to generate an event

Document. Body. scrolltop; returns and sets the coordinate value of the current vertical scroll bar, which must be used with the function,
Document. Body. scrollleft; returns and sets the coordinate value of the current Horizontal Rolling task, which must be used with the function,
Document. title document. Title = "message"; title bar Text of the current window
Document. bgcolor document. bgcolor = "color value"; change the background color of the window.
Document. fgcolor document. fgcolor = "color value"; change the body color
Document. linkcolor document. linkcolor = "color value"; change the superjoin color.
Document. alinkcolor document. alinkcolor = "color value"; change the color of the click link.
Document. vlinkcolor document. vlinkcolor = "color value"; change the color of the accessed Link
Document. Forms. Length returns the number of form forms on the current page
Document. Anchors. Length returns the number of anchors on the current page.
Document. Links. Length returns the number of connections on the current page.
Document. onmousedown = x click the mouse to trigger the event
Document. ondblclick = X double-click mouse trigger event
Defaultstatus window. Status = defaultstatus; set the status bar to display by default

Function function XX () {...} defines a function
Isnumeric determines whether it is a number
Innerhtml xx = object. innerhtml: Enter the HTML source code in an object tag.
Innertext divid. innertext = xx

Location. Reload (); refresh the current page. The target can be equal to a refreshed webpage.

Math. Random () random Han number, which can only be a number between 0 and 1. To get another number, it can be * 10 and then rounded up.
Math. Floor (number) converts the object number into an integer and returns all decimals.
Which of the following values is returned for math. Min (1, 2 )?
Which of the following values is returned for math. Max (1, 2 )?

Navigator. appname: returns the name of the current browser.
Navigator. appversion: returns the current browser version.
Navigator. appcodename: returns the name of the current browser code.
Navigator. useragent returns the user ID of the current Browser

Onsubmit = "Return (XX ()" use function return value
Opener opener.doc ument. Object Control Original open form object

Prompt xx = Window. Prompt ("prompt message", "pre-value"); input statement
Parent. Framework name. Object Control Framework page

Return return false return value
Random random parameter (between 0 and 1)
Reset () form. Reset (); reset the data in the form

Split ("") string. Split ("") Separate String object characters with commas
Submit () form object. Submit () enables the form object to submit data

The charat (x) object of the string object returns the nth Letter of the specified object.
Lastindexof ("string") searches for the specified character from right to left.-1 is not returned.
Indexof ("string"): query the specified character from left to right.-1 is not returned.
Lowercase () converts all objects to lowercase letters
Uppercase () converts all objects to uppercase
Substring () 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 () obtains the time from the X time object, which exists as a string.
Typeof (variable name) checks the type of the variable. The values include string, Boolean, object, function, and underfined.

Window. event. Button = 1/2/3 left mouse button equals 1 right button equals 2 press 3 together
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.doc ument. Body. offsetheight; returns the current webpage height.
Specified parameter Doc ument. Body. offsetwidth; returns the current webpage width.
Window. resizeTo () set the window width and height
Window. moveTo (0, 0) Move the window to a certain position
Window. Focus () to make the current window focus
Window. Scroll (x, y) coordinates of the window scroll bar. y controls the up and down movement and must work with functions.
Window. open () window. Open ("Address", "name", "attribute ")
Attributes: toolbar (toolbar), location (address bar), ctions, status (status bar ),
Menubar, scrollbar, resizable, width, height, fullscreen ), scrollbars (no scroll bar and no parameter in full screen mode, channelmode (wide screen), left (opening window X coordinate), top (opening window y coordinate)
Window. Location = 'view-Source: '+ window. Location. href application event view webpage source code;

A = new date (); // create a as a new period object
Y = A. getyear (); // The value of Y is the two-digit year from object.
Y1 = A. getfullyear (); // obtain the four-digit year count
M = A. getmonth (); // obtain the month value.
D = A. getdate (); // obtain the date value
D1 = A. getday (); // obtain the value of the current week
H = A. gethours (); // obtain the current hour
M1 = A. getminutes (); // get the current number of minutes
S = A. getseconds (); // obtain the number of current seconds

Object. style. fontsize = "text size ";
Unit: mm/CM/in inch/PC/PT point/PX pixel/EM text height
1In = 1.25
1 Pc = 12pt
1pt = 1.2px (800*600 resolution)

Text font attributes:
Fontsize
Family font
Color
Fontstyle. The value is normal, italic, and oblique italic and bold.
Fontweight bold, ranging from 100 to 900, 900 rough, light, normal, bold
Letterspacing distance, change the text distance, value: 1pt, 10px, 1 cm
Textdecoration: Text modifier; optional values: None, underline, and overline
Background: Text background color,
Backgroundimage: background image. The value is the insert path of the image.

Click function call trigger on the webpage body:

1. onclick when an object is clicked
2. onload when a webpage is opened, it can only be written in the body
3. onUnload: When a webpage is closed or left, it can only be written in the body.
4. onmouseover when the mouse hangs over it
5. onmouseout when the mouse leaves the object
6. onmouseup when the mouse is released
7. onmousedown when the mouse presses the key
8. onfocus: when the object obtains the focus
9. onselect when the object text is selected
10. onchange when the object content is changed
11. onblur when the object loses focus
Onsubmit = return (SS () value returned when the form is called

Straight Line border-bottom: 1x solid black
Dotted Line border-bottom: 1x dotted black
Dash border-bottom: 2x dashed black
Double Line border-bottom: 5x double black
Slot border-bottom: 1x groove black
Ridge border-bottom: 1x ridge black


Related Article

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.