//定义"改变颜色"的函数
function color(){
var txt=document.getElementById("txt");
txt.style.color="red";
txt.style.backgroundColor="#ccc";
};
//定义"改变宽高"的函数
function wh(){
var txt=document.getElementById("txt");
txt.style.width="300px";
txt.style.height="400px";
};
function color(){
var txt=document.getElementById("txt");
txt.style.color="red";
txt.style.backgroundColor="#ccc";
};
//定义"改变宽高"的函数
function wh(){
var txt=document.getElementById("txt");
txt.style.width="300px";
txt.style.height="400px";
};
已采纳回答 / hernandes
兄弟,hello world??不懂你问的什么,这一节内容就是修改标签内容啊,注意是内容,修改后浏览器自动编译当然显示新得内容,当然这些动作我们是看不见的
2016-05-15
已采纳回答 / LCchao
<script type="text/javascript"> var score=80; if(score>=60&&score<=70){document.write("恭喜及格了");} else if(score>=80){document.write("优秀");} else{document.write("无");} </script>;位置错误
2016-05-15
已采纳回答 / 传说408崛起
function add(){ var p1 = document.getElementById("p1"); document.write(p1.className+"<br>"); }改成 function add(){ var p1 = document.getElementById("p1"); p1.className = "one"; }
2016-05-15
已采纳回答 / qq_天道酬勤_5
第二个更加准确和清楚,直接说明了链接的JavaScript文件是一个JavaScript文档。第二个是标准的JavaScript外部导入样式。
2016-05-15
function lq(){
var lqq;
lqq = prompt("你对此游戏的评价是多少?(0~100分)");
if(lqq>=100){
document.write("非常给力!");
}
else if(lqq>=60){
document.write("还不错~!");
}
else{
document.write("oh~希望不会影响到您~如果影响到了就跟我们嘿嘿嘿,如果没有影响到您,您就和他嘿嘿嘿");
}
}
var lqq;
lqq = prompt("你对此游戏的评价是多少?(0~100分)");
if(lqq>=100){
document.write("非常给力!");
}
else if(lqq>=60){
document.write("还不错~!");
}
else{
document.write("oh~希望不会影响到您~如果影响到了就跟我们嘿嘿嘿,如果没有影响到您,您就和他嘿嘿嘿");
}
}
2016-05-15
var mystr="我是";
var mychar="JavaScript";
document.write("<br/>")
document.write(mystr+mychar+"的忠诚粉丝")
var mychar="JavaScript";
document.write("<br/>")
document.write(mystr+mychar+"的忠诚粉丝")
2016-05-15