运行一下这个,看看select的属性。<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title></title> </head> <body> <select id=test> </select> <SCRIPT LANGUAGE="JavaScript"> <!-- for (a in test) { if (a == "title") document.write("<FONT SIZE='6' COLOR='red'>") document.write(a+"\t"); if (a == "title") document.write("</FONT>") } //--> </SCRIPT> </body> </html>
好可爱的emu,顺便教你一招 a.fontcolor("red").fontsize(6)ps.有属性不一定等于有效,所以DHTML中不敢写<select id=test> </select> <SCRIPT LANGUAGE="JavaScript"> <!-- for (a in test){ if (a == "title") a=a.fontcolor("red").fontsize(6) document.write(a+"\t"); } //--> </SCRIPT>
好玩儿,书里好像没有讲的。这个title真的出不来了吗?
好玩儿,书里好像没有讲的。这个title真的出不来了吗?
哈哈,看到它是怎么做的啦,原来创建了font对象来的var a = "adfsdf"; a=a.fontsize(6).fontcolor("red") alert(a)
it works when SELECT is disabled, :-), try<select name="NAME" size="1" disabled title="This text should appear in a tooltip popup."> <option>Option1 </option> <option>Option2 </option> <option>Option3 </option> </select>see PRB: Internet Explorer Does Not Display Title Attribute Using the Select Tag (Q221608) http://support.microsoft.com/default.aspx?scid=kb;EN-US;q221608
看到了Microsoft has confirmed this to be a bug in the Microsoft products 唉,真的是一个bug来的
Scripting object.title [ = sTitle ] Applies To
A, ACRONYM, ADDRESS, APPLET, AREA, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CITE, CODE, COLGROUP, custom, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FORM, FRAME, FRAMESET, Hn, HR, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP
我的书上写的清清楚楚的:IE4: WIN16 WIN32 MAC UNIX
--------------------------------------------------------
......,Q,S, SAMP,SELECT,SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE,......IE5: WIN16 WIN32 MAC UNIX
-----------------------------------------------------
BDO,RT,RUBY
Microsoft Press 《动态HTML参考和开发应用大全》(人民邮电出版社)
--------------------------------------
属性/特性
..................tagName*,tagUrn*,title,type,uniqueID*
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
<select id=test>
</select>
<SCRIPT LANGUAGE="JavaScript">
<!--
for (a in test)
{
if (a == "title") document.write("<FONT SIZE='6' COLOR='red'>")
document.write(a+"\t");
if (a == "title") document.write("</FONT>")
}
//-->
</SCRIPT>
</body>
</html>
a.fontcolor("red").fontsize(6)ps.有属性不一定等于有效,所以DHTML中不敢写<select id=test>
</select>
<SCRIPT LANGUAGE="JavaScript">
<!--
for (a in test){
if (a == "title") a=a.fontcolor("red").fontsize(6)
document.write(a+"\t");
}
//-->
</SCRIPT>
a=a.fontsize(6).fontcolor("red")
alert(a)
disabled title="This text should appear in a tooltip popup.">
<option>Option1 </option>
<option>Option2 </option>
<option>Option3 </option>
</select>see
PRB: Internet Explorer Does Not Display Title Attribute Using the Select Tag (Q221608)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q221608