Ads by Lake Quincy Media
| Next Tip?
Home » HTML, Technology News

HTML – A STEP AHEAD SERIES Part II

2 November 2008 430 views One Comment
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3.00 out of 5)
Loading ... Loading ...

Email To Friend Email To Friend
Attributes

Greetings!!!

In the last session we disused the structure of an HTML Document…. In this article we are going to cover some of the basic tags which which we normally use to format a document.

Before discussing it let me clear a term Attribute

Attribute is a Pieces of information attached to an element and defined in its start tag. It is the Aspects of information about a content object. Attributes may be fields, tags. etc.

Special Note:- Please Provide the values of the attributes in the double quotation sign as “value”

Now let us divide these attributes into three categories for our convince

1. Standard Attributes:– Common for most of the elements or tags
2. Event Attributes:- The ability to let HTML events trigger actions in the browser, like starting a JavaScript when a user clicks on an HTML element. Below is a list of attributes that can be inserted into HTML tags to define event actions.
3. Optional Attributes:- The Attributes which are specialy for the tag or element and are optional to use

Standard Attributes:–

1. Id
* value:– id_name
* Description:– A unique id for the element through which it will be accesed later anywhere in the document.
* Note:– Not valid in base, head, html, meta, param, script, style, and title elements.
2. class
* Value:– class_rule or style_rule
* Description:– The class of the element which describes its style or some scripts
* Note:– Not valid in base, head, html, meta, param, script, style, and title elements.
3. Title
* Value:– tooltip_text
* Description:– A text to display in a tool tipfor the element when mouse comes over the element.
* Note:– Not valid in base, head, html, meta, param, script, style, and title elements.
4. Style
* Value:– style_definition
* Description:– An inline style definition partivular for the element to give some special look
* Note:– Not valid in base, head, html, meta, param, script, style, and title elements.
5. Dir
* Value:– ltr | rtl
* Description:– Sets the text directionof the element from left to right or right to left.
* Note:– Not valid in base, br, frame, frameset, hr, iframe, param, and script elements.
6. Lang
* Value:– language_code
* Description:–Sets the language code
* Note:–
7. accesskey
* Value:– character
* Description:–Sets a keyboard shortcut to access an element if user wants to use keyboard.
* Note:–
8. tabindex
* Value:– number
* Description:–Sets the tab order of an element to enalbe tab key of the keyboard
* Note:–

Event Attributes:–
The ability to let HTML events trigger actions in the browser, like starting a JavaScript when a user clicks on an HTML element. Below is a list of attributes that can be inserted into HTML tags to define event actions.

1. onclick
* Value:– script
* Description:– Sepcifies what action to be performed on a mouse click
* Note:–Mouse Event, Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
2. ondblclick
* Value:– script
* Description:– Sepcifies what action to be performed on a mouse double click
* Note:- Mouse Event, Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
3. onmousedown
* Value:– script
* Description:–Sepcifies what action to be performed when mouse button is pressed
* Note:- Mouse Event, Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
4. onmouseup
* Value:– script
* Description:– Sepcifies what action to be performed when mouse button is released
* Note:- Mouse Event, Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
5. onmouseover
* Value:– script
* Description:– Sepcifies what action to be performed when mouse pointer moves over an element
* Note:- Mouse Event, Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
6. onmousemove
* Value:– script
* Description:– Sepcifies what action to be performed when mouse pointer moves
* Note:- Mouse Event, Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
7. onmouseout
1. Value:– script
2. Description:– Sepcifies what action to be performed when mouse pointer moves out of an element
3. Note:-Keyboard Events , Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
8. onkeypress
* Value:– script
* Description:– Sepcifies what action to be performed when key is pressed and released
* Note:- Keyboard Events , Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
9. onkeydown
* Value:– script
* Description:– Sepcifies what action to be performed when key is pressed.
* Note:- Keyboard Events , Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
10. onkeyup
* Value:– script
* Description:– Sepcifies what action to be performed when key is released
* Note:- Keyboard Events , Not valid in base, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.
11. onLoad
* Value:– script
* Description:–Script to be run when a document loads
* Note:-Window Events Only valid in body and frameset elements
12. onunload
* Value:– script
* Description:–Script to be run when a document unloads
* Note:- Window Events Only valid in body and frameset elements
13. onchange
* Value:– script
* Description:– Script to be run when the element changes
* Note:- Form Element Events Only valid in form elements.
14. onsubmit
* Value:– script
* Description:– Script to be run when the form is submitted
* Note:- Form Element Events Only valid in form elements.
15. onreset
* Value:– script
* Description:– Script to be run when the form is reset
* Note:- Form Element Events Only valid in form elements.
16. onselect
* Value:– script
* Description:– Script to be run when the element is selected
* Note:- Form Element Events Only valid in form elements.
17. onblur
* Value:– script
* Description:– Script to be run when the element loses focus
* Note:- Form Element Events Only valid in form elements.
18. onfocus
* Value:– script
* Description:– Script to be run when the element gets focus
* Note:- Form Element Events Only valid in form elements.

++
Thanks and Regards
Meetu Choudhary

Popularity: 2%

Post to Twitter Tweet This Post

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Ads by Lake Quincy Media

One Comment »

  • Gaurav said:

    Hi Meetu!

    Again a good article for beginners. I appreciate your writting.

    Bets of Luck!
    Gaurav

Leave your response!

You must be logged in to post a comment.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes