Monday, November 8, 2010

Java script Events.

      நாம் javascript ஐ ஒரு செயலை run செய்யும் போது HTML fornt end ஆக வைத்து javascript ஐ back end ஆக வைத்து run செய்வோம் உதாரணமாக error check ஐ வைத்துக்கொள்வோம் இதை பற்றி முந்தைய பதிப்பில் பார்த்திருக்கிறோம். அதில் முதல் படம் javascript coding இரண்டாவது படம் html coding இவற்றின் செயல்பாடு error chek செய்வது இந்த function ஐ போல பல function உள்ளது கிழே உள்ளதை பாருங்கள்.

• onabort - Loading of an image is interrupted
• onblur - An element loses focus
• onchange - The content of a field changes
• onclick - Mouse clicks an object
• ondblclick - Mouse double-clicks an object
•onerror - An error occurs when loading a document or an image
• onfocus - An element gets focus
• onkeydown - A keyboard key is pressed
• onkeypress - A keyboard key is pressed or held down
• onkeyup - A keyboard key is released
• onload - A page or an image is finished loading
• onmousedown - A mouse button is pressed
• onmousemove - The mouse is moved
• onmouseout - The mouse is moved off an element
• onmouseover - The mouse is moved over an element
• onmouseup - A mouse button is released
• onreset - The reset button is clicked
• onresize - A window or frame is resized
• onselect - Text is selected
• onsubmit - The submit button is clicked
• onunload - The user exits the page

மேலே உள்ள function வைத்து Mouse,Keyboard,Frame/Object மற்றும் form ல் பல செயல்பாடுகள் செய்யலாம் உதாரணமாக ஒரு function ஐ பார்ப்போம்.

change function ஐ வைத்துக்கொள்வோம் அவை எவ்வாறு இருக்கும் என்று பார்ப்போம். button ஐ click செய்தால் text change ஆகி next text display ஆகும். முதலில் javascript function ஐ open செய்து document ல் id value p1 வைத்துக்கொள்ளுங்கள் innerHTML program ல் முதலாவது text ஐ type செயுங்கள் அடுத்துதாக button click செய்தால் next text display ஆக id value ஐ body குல் கொடுத்து next text ஐ display ஆக இங்கு டைப் செய்யுங்கள் change button ஐ உருவாக்கிகொள்ளுங்கள்.

OUTPUT:

No comments:

Post a Comment