js控制title的问题 问题如下<input id="test" title="<B>test</B>" />我想通过js修改title的值控件.title="<B>ccccc</B>"但是却显示 <B>ccccc</B>通过js控制title的怎么能把样式带进去啊在线等~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 晕死!title 里面怎么加样式 啊 四个字,未必没戏!title 是死的,可人是活的!L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>js.smartTitle</title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> <input type="text" id="txtHehe" value="把鼠标移上来看看哈" /> <input type="text" id="txtHaha" value="把鼠标移上来看看哈" /> </body> <script type="text/javascript"> <!--function AddSmartTitle(sId, innerHTML){ if (this.TipRegion === undefined) { this.TipRegion = document.body.appendChild(document.createElement("div")); this.TipRegion.style.padding = "5px 5px 5px 5px"; this.TipRegion.style.fontSize = "13px"; this.TipRegion.style.border = "solid 1px black"; this.TipRegion.style.backgroundColor = "#FFFFD5"; this.TipRegion.style.display = "none"; } var target = document.getElementById(sId); //alert(target); if (target) { target.TipRegion = this.TipRegion; target.onmouseover = function() { this.TipRegion.style.position = "absolute"; this.TipRegion.innerHTML = innerHTML; var topDis = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop; this.TipRegion.style.top = event.clientY + topDis; this.TipRegion.style.left = event.clientX; this.TipRegion.style.display = "block"; }; target.onmouseout = function() { this.TipRegion.style.display = "none"; }; }}AddSmartTitle("txtHehe", "<i style='color: blue'>只有想不到</i>,");AddSmartTitle("txtHaha", "<b style='color: red'>没有做不到</b>!<br />——yixianggao"); //--> </script></html> 修改了一下可以兼容 FF 了L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>js.smartTitle</title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> <input type="text" id="txtHehe" value="把鼠标移上来看看哈" /> <input type="text" id="txtHaha" value="把鼠标移上来看看哈" /> </body> <script type="text/javascript"> <!--function AddSmartTitle(sId, innerHTML){ if (this.TipRegion === undefined) { this.TipRegion = document.body.appendChild(document.createElement("div")); this.TipRegion.style.padding = "5px 5px 5px 5px"; this.TipRegion.style.fontSize = "13px"; this.TipRegion.style.border = "solid 1px black"; this.TipRegion.style.backgroundColor = "#FFFFD5"; this.TipRegion.style.display = "none"; } var target = document.getElementById(sId); if (target) { target.TipRegion = this.TipRegion; target.onmouseover = function(event) { event = event ? event : window.event; this.TipRegion.style.position = "absolute"; this.TipRegion.innerHTML = innerHTML; var topDis = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop; this.TipRegion.style.top = event.clientY + topDis + "px"; this.TipRegion.style.left = event.clientX + "px"; this.TipRegion.style.display = "block"; }; target.onmouseout = function() { this.TipRegion.style.display = "none"; }; }}AddSmartTitle("txtHehe", "<i style='color: blue'>只有想不到</i>,");AddSmartTitle("txtHaha", "<b style='color: red'>没有做不到</b>!<br />——yixianggao"); //--> </script></html> 5,6楼的是用层来模拟出的title,标签自带的title是没办法加入样式的! 鼠标移动菜单IE8下没问题,IE6下不出来 js控制弹出一个<div>或页面,用来存放我取到的图片 奇怪的ComboBox和DateField 已经实现了在textarea里添加并显示button,但是不知道如何实现在textarea内拖动button 关于window.open的使用 求教javascript高手 在js中,如果将一个数字转为二进制? 请教这个问题的实现方法,解决立即结帖 大家帮帮忙 小弟论坛开张了,请大家有空去坐坐阵!(注:是动网论坛,小弟无能力自己编) 最基本的问题 今天很郁闷,自己的代码被废了 关于callback的一个问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>js.smartTitle</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<input type="text" id="txtHehe" value="把鼠标移上来看看哈" />
<input type="text" id="txtHaha" value="把鼠标移上来看看哈" />
</body>
<script type="text/javascript">
<!--
function AddSmartTitle(sId, innerHTML)
{
if (this.TipRegion === undefined) {
this.TipRegion = document.body.appendChild(document.createElement("div"));
this.TipRegion.style.padding = "5px 5px 5px 5px";
this.TipRegion.style.fontSize = "13px";
this.TipRegion.style.border = "solid 1px black";
this.TipRegion.style.backgroundColor = "#FFFFD5";
this.TipRegion.style.display = "none";
} var target = document.getElementById(sId);
//alert(target);
if (target) {
target.TipRegion = this.TipRegion;
target.onmouseover = function() {
this.TipRegion.style.position = "absolute";
this.TipRegion.innerHTML = innerHTML;
var topDis = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop;
this.TipRegion.style.top = event.clientY + topDis;
this.TipRegion.style.left = event.clientX;
this.TipRegion.style.display = "block"; }; target.onmouseout = function() {
this.TipRegion.style.display = "none";
};
}
}AddSmartTitle("txtHehe", "<i style='color: blue'>只有想不到</i>,");
AddSmartTitle("txtHaha", "<b style='color: red'>没有做不到</b>!<br />——yixianggao");
//-->
</script>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>js.smartTitle</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<input type="text" id="txtHehe" value="把鼠标移上来看看哈" />
<input type="text" id="txtHaha" value="把鼠标移上来看看哈" />
</body>
<script type="text/javascript">
<!--
function AddSmartTitle(sId, innerHTML)
{
if (this.TipRegion === undefined) {
this.TipRegion = document.body.appendChild(document.createElement("div"));
this.TipRegion.style.padding = "5px 5px 5px 5px";
this.TipRegion.style.fontSize = "13px";
this.TipRegion.style.border = "solid 1px black";
this.TipRegion.style.backgroundColor = "#FFFFD5";
this.TipRegion.style.display = "none";
} var target = document.getElementById(sId);
if (target) {
target.TipRegion = this.TipRegion;
target.onmouseover = function(event) {
event = event ? event : window.event;
this.TipRegion.style.position = "absolute";
this.TipRegion.innerHTML = innerHTML;
var topDis = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop;
this.TipRegion.style.top = event.clientY + topDis + "px";
this.TipRegion.style.left = event.clientX + "px";
this.TipRegion.style.display = "block";
}; target.onmouseout = function() {
this.TipRegion.style.display = "none";
};
}
}AddSmartTitle("txtHehe", "<i style='color: blue'>只有想不到</i>,");
AddSmartTitle("txtHaha", "<b style='color: red'>没有做不到</b>!<br />——yixianggao");
//-->
</script>
</html>