当前位置: 代码迷 >> JavaScript >> 改颜色的有关问题,哪位解决一下,谢拉!
  详细解决方案

改颜色的有关问题,哪位解决一下,谢拉!

热度:233   发布时间:2012-02-12 17:16:33.0
改颜色的问题,哪位大虾解决一下,谢拉!!!
请大家看看这段代码,我想实现文字颜色的改变,我见过用这种方法实现的,但是我就实现不了,哪位大虾帮偶解决一下?谢拉!!


<!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>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
<script   language= "javascript ">
function   change()
{
var   div=document.getElementById( "mmp1 ");
div.innerHTML.style= "color:#FF99CC ";
}
</script>
</head>

<body>
<p     id= "mmp1 "   style= "font-family:Arial,   Helvetica,   sans-serif;   color:#0099FF;   font-weight:600;   "   onmouseover= "change() "> My   QQ:   461406134 </p>
</body>
</html>

------解决方案--------------------
<!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>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
<script language= "javascript ">
function change()
{
var div=document.getElementById( "mmp1 ");
div.style.color= "#FF99CC ";
}
</script>
</head>

<body>
<p id= "mmp1 " style= "font-family:Arial, Helvetica, sans-serif; color:#0099FF; font-weight:600; " onmouseover= "change() "> My QQ: 461406134 </p>
</body>
</html>

------解决方案--------------------
<script language= "javascript ">
function change()
{
var div=document.getElementById( "mmp1 ");
div.style.color= "#FF99CC ";
}
</script>
  相关解决方案