<script type="text/javascript">
document.write("开启JS之旅!");
</script>
document.write("开启JS之旅!");
</script>
2016-04-18
照理说函数建立后是不能自动执行的,需要调用。那么这里的函数为什么没有被调用就生效了?
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
2016-04-18
这样不能过我不服
var add2= contxt() //定义函数
{
alert("哈哈,调用函数了!");
}
var add2= contxt() //定义函数
{
alert("哈哈,调用函数了!");
}
2016-04-17
已采纳回答 / one丿pieceLJ
document.write("hello"); document.getElementById("p1").style.color="blue";
2016-04-17
最新回答 / 慕粉3166661
function openWindow() { var open = confirm("窗口是否打開?"); var url = "http://www.imooc.com/"; if(open == true){ confirm("打開網址"+ url); window.open("url","_blank","width=400, height=500, menubar=no, toolbar=no") ...
2016-04-17
function openWindow(){
var mymessage=confirm("确认要打开新窗口?");
var myurl="http://www.imooc.com/";
if(mymessage==true){
prompt("您要打开的网址为:","http://www.imooc.com/");
window.open(myurl,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
var mymessage=confirm("确认要打开新窗口?");
var myurl="http://www.imooc.com/";
if(mymessage==true){
prompt("您要打开的网址为:","http://www.imooc.com/");
window.open(myurl,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}