如果你要文字變色
<pre class="c" name="code">
<script type="Text/Javascript" language="JavaScript">
<!--
var aaaaa = document.getElementById("pageIn");
var bbbbb = aaaaa.getElementsByTagName("form")[0];
var ccccc = bbbbb.previousSibling.previousSibling;
var eeeee = document.getElementById("container");
var fffff = eeeee.getElementsByTagName("div");
var wantid = -1;
for (iii = 0;iii < fffff.length;iii++)
{
if (fffff[iii].id == "history_div")
{
wantid = iii - 1;
break;
}
}
var ggggg = fffff[wantid].getElementsByTagName("a");
for (jjj = 0;jjj < ggggg.length;jjj++)
{
if (ggggg[jjj].href == ccccc.href)
{
ggggg[jjj].style.color = "red";
break;
}
}
//-->
</script>
如果你要點過變色 自己去改CSS
http://www.sunte.com.tw/themes/lativ/style.css
附上講解版
<pre class="c" name="code">
<style>
#aid{
cursor:pointer; /*讓鼠標成為手指圖案*/
}
/*「#aid」代表搜尋「id」為「aid」的元素,「:hover」代表「滑鼠移入時」*/
#aid:hover{
color:blue; /*讓滑鼠移入時,文字改變顏色*/
}
</style>
<a id="aid">hello world</a>
<!-- 滑鼠點下去文字顏色改變可以使用jquery的click() -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$("#aid").click(function(){
//當滑鼠點下時即觸發以下內容
$(""#aid"").css("color","black");
})
</script>
以下為無講解版
<pre class="c" name="code">
<style>
#aid{
cursor:pointer;
}
#aid:hover{
color:blue;
}
</style>
<a id="aid">hello world</a>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$("#aid").click(function(){
$(""#aid"").css("color","black");
})
</script>