title attribute | title property
[This documentation is preliminary and is subject to change.]
Sets or retrieves advisory information (a ToolTip) for the object.
![]() |
Syntax
| HTML | <element title="p" ... > |
|---|---|
| JavaScript | |
Property values
Type: String
the advisory text.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
- HTML 4.01 Specification, Section 7.4.3
Remarks
Windows Internet Explorer renders the title as a ToolTip when the user hovers the mouse over the object.
Titles are limited to 512 total characters; this limit includes control characters, such as line feeds, carriage returns, and so on.
In Windows CE, ToolTips do not appear when a user hovers the mouse pointer over objects.
Renders the title as a ToolTip when the user hovers a mouse or finger over objects
Titles are limited to 512 total characters; this limit includes control characters, such as line feeds, carriage returns, and so on.
Examples
This example uses the title property to display advisory text when the user hovers the mouse pointer over the text.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/title_1.htm
<SCRIPT>
function boldAdvise(src) {
src.title="this is bold text";
return;
}
</SCRIPT>
:
<SPAN onmouseover="boldAdvise(this)">bold section</SPAN>
See also
- a
- abbr
- acronym
- address
- applet
- area
- article
- aside
- b
- bdo
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- col
- colGroup
- custom
- dd
- del
- dfn
- dir
- div
- dl
- dt
- em
- embed
- fieldSet
- figcaption
- figure
- font
- footer
- form
- frame
- frameSet
- head
- header
- hgroup
- hn
- hr
- html
- i
- iframe
- img
- input type=button
- input type=checkbox
- input type=file
- input type=hidden
- input type=image
- input type=password
- input type=radio
- input type=reset
- input type=submit
- input type=text
- ins
- isIndex
- kbd
- label
- legend
- li
- listing
- map
- mark
- marquee
- menu
- nav
- nextID
- noBR
- object
- ol
- optGroup
- option
- p
- plainText
- pre
- q
- rt
- ruby
- s
- samp
- section
- select
- small
- span
- strike
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- tr
- tt
- u
- ul
- var
- xmp
- title
Build date: 3/8/2012
Neither way, works:--
<element TITLE=expression(...)
dhtmobj.title = expression(...);
(Expression() works nicely elsewhere.)
- 7/18/2008
- Mr. Raymond Kenneth Petry
- 7/18/2008
- Thomas Lee
