Javascript在什么上运行啊?给个可以运行的

还有那些函数都是自带的吗?不要自己弄的吧
具体点,怎么运行的啊,浏览器怎么弄啊?

浏览器上。
<html>
<body>
<table border=1 style="cursor:hand">
<tr>
<td id="td1" style="background-color:#66B3FF" onclick=tdclick(this)>产品1</td>
<td id="td2" style="background-color:#FFFFFF" onclick=tdclick(this)>产品2</td>
<td id="td3" style="background-color:#FFFFFF" onclick=tdclick(this)>产品3</td>
</tr>
</table>
<script type="text/javascript">
function tdclick(obj){
var tdid=obj.id;
var temp = tdid.substring(2,tdid.length); //如:拿td3最后的3以下面判断使用
for(var i=1;i<=3;i++){
if(temp == i){
document.getElementById("td"+i).style.backgroundColor="#66B3FF";
}else{
document.getElementById("td"+i).style.backgroundColor="#FFFFFF";
}
}
}
</script>
</body>
</html>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-11-02
<br>
主题名称:其它<br>
<br>
特效名称:中文日期<br>
<br> [无须修改][共1步]]

<br>1、将以下代码加入HEML的<body></body>之间

<script LANGUAGE="JavaScript">
function number(index1){
var numberstring="一二三四五六七八九十";
if(index1 ==0) {document.write("十")}
if(index1 < 10){
document.write(numberstring.substring(0+(index1-1),index1))}
else if(index1 < 20 ){
document.write("十"+numberstring.substring(0+(index1-11),(index1-10)))}
else if(index1 < 30 ){
document.write("二十"+numberstring.substring(0+(index1-21),(index1-20)))}
else{
document.write("三十"+numberstring.substring(0+(index1-31),(index1-30)))}
}
var today1 = new Date()
var month = today1.getMonth()+1
var date = today1.getDate()
var day = today1.getDay()
document.write("<br><strong><small><center>")
document.write("公元二零零零年")
number(month)
document.write("月")
number(date)
document.write("日</small><center>")
</script>