Web Design
Mobile Internet
Brand Design
Innovative
News
Encyclopedias

Website Production Tutorial JavaScript Client Mouse Event Driven Complete

Date:2016-12-12 Source: Shangpin China Type: website encyclopedia
Word Size: small   medium   big

JavaScript is an object based language. The basic characteristics of object-based Website Design Event driven. The actions of the user using the mouse or hotkey on the client side are called events, and the actions of a series of programs triggered by the mouse or hotkey are called event driven. There are mainly the following events:

Click Event (onClick)

When Marketing website construction When the user clicks the mouse button, the onClick event is generated, and the event handler specified by onClick will be called to execute. Generally, click events are applied to buttons, checkboxes, radio buttons, reset buttons, and submit buttons.

For example:
 Click Event Code


Save the above code as "onclick. htm", open it with a browser, click "Click Me", and the result is as shown in Figure 1.21.
 Click Event

Change event (onChange)

 Change Event Code
 Change event (onChange) code

Save the above code as "onchange. htm", open it with a browser, change the value of the text box, and the page prompt is shown in Figure 1.22.
 Onchange event
Once the value of the text box changes, the onChange event is triggered and the check function is executed.

Selected event (onSelect)
 Selected event code

Save the above code as "onselect. htm", open it with a browser, and select some text in the text field, as shown in Figure 1.23.

 Selected event (onSelect)


Load event (onLoad)

 Load event (onLoad) code

Save the above code as "onload. htm" and open it with a browser, as shown in Figure 1.24.

 Load event (onLoad)

The loading event is executed when you first enter the page.

Unload event (onUnload)

 Unload event (onUnload) code

Save the above code as "onunload. htm" and open it with a browser, as shown in Figure 1.25.
 Unload event (onUnload)

The unload event is executed when leaving the page.


Please contact our consultant

+86 10-60259772

Please provide your contact number. The project manager of shangpin China will contact you as soon as possible.