EN
此内容没有您的语言版本,但有英语版本。

title attribute | title property

Sets or retrieves advisory information (a ToolTip) for the object.

HTML 4.01 Specification, Section 7.4.3

Syntax

HTML<element title="p" ... >
JavaScript

p = object.title

Property values

Type: String

the advisory text.

Standards information

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.

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 type="text/javascript">
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
document
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=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
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

 

 

显示:
© 2014 Microsoft