1. Technology

Your suggestion is on its way!

An email with a link to:

http://webdesign.about.com/dynamichtml/a/aadhtmlatts_2.htm

was emailed to:

Thanks for sharing About.com with others!

Dynamic HTML Attributes

page 2 
    Email to a friend
 Printer friendly version

Web Design Path
• Advanced HTML

Related Resources
• What is DHTML?
• Change Text Color Dynamically
• What is the DOM?

More DHTML Help
• W3C DOM Compatibility
• DHTML Scripts
• DHTML Links

About Web Design
Subscribe to the Free Newsletter
Your Email Address:

 
 

Attributes of XHTML Tags for DHTML - onfocus onselect

 

Key Related Events

onkeydown
The onkeydown attribute activates when a key is pressed down. This and the other key related events can often be difficult to activate over specific elements other than the entire body of the document.

The onkeydown attribute works with all elements but applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, and title.

onkeyup
The onkeyup attribute activates when a key is released.

The onkeyup attribute works with all elements but applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, and title.

onkeypress
The onkeypress attribute activates when a key is pressed and released.

The onkeypress attribute works with all elements but applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, and title.

Focus Related Events

onfocus
The onfocus attribute refers to when the focus or attention of the browser is on that element. This would be in a form field when the cursor is blinking in that field, or when an anchor element is highlighted. Scripts are kicked off when that element gains the focus.

The onfocus attribute works with the following elements: a, area, button, input, label, select, and textarea.

onblur
The onblur attribute is the opposite of the onfocus attribute. It kicks off the script when the focus leaves the element, such as when the next form element is activated or some other portion of the screen is clicked.

The onblur attribute works with the following elements: a, area, button, input, label, select, and textarea.

Form Specific Events

onchange
The onchange attribute takes effect when the element value was changed.

The onchange attribute works with the input, select, and textarea elements.

onselect
The onselect attribute takes effect when some text is highlighted within a form field.

The onselect attribute works with the input and textarea elements.

onreset
The onreset attribute takes effect when the form is reset (ie. the customer clicks on the reset button).

The onreset attribute works with only the form element.

onsubmit
The onsubmit attribute takes effect when the form is submitted (ie. the customer clicks on the submit button).

The onsubmit attribute works only with the form element.

Page and Frame Related Events

onload onunload

onload
The onload attribute works when the page or frame is completely loaded into the browser. Note that some browsers execute this event when the page is first loaded, and others wait until every element of the page is loaded.

The onload attribute works only with the body and frameset elements.

onunload
The onunload attribute works when the page or frame is exited.

The onunload attribute works only with the body and frameset elements.

 
 ~ Jennifer Kyrnin
previous |1 |2

©2014 About.com. All rights reserved.