最新回答 / 可爱的小法师
if(p1.className="one") p1.className="two"; if(p1.className="two") p1.className="one";
2017-01-20
最新回答 / 仁兄
是confirm用错了,应该是var b=confirm("是否取消设置?"); if(b!=false){ var ob1=document.getElementById("txt"); ob1.removeAttribute('style'); }或者可以把if换成if(confirm("是否取消设置?")==true)
2017-01-19
最新回答 / 慕尼黑9128539
window.alert = function(str) { var shield = document.createElement("DIV"); shield.id = "shield"; shield.style.position = "absolute"; shield.style.left = "0px"; shield.style.top = "0px"; shield.style.width = "100%"; shield.style.height = document.body.scro...
2017-01-19
最新回答 / 乾坤易
这是一个函数,后面还有一个大括号括起来,完整的函数是这样:function rec() { 实现特定功能的代码;}其中rec是可以改变,自己定义的,只要不跟javascript关键字冲突,并符合函数名定义规范即可,函数一般是一段可以实现特定功能的代码段,在html中可重复调用它来实现想要的功能,应用示例:<input type="button" value="两数之和" onclick="add()"/><javascript >function add() {var sum...
2017-01-19
最新回答 / qq_孤独的风_1
1. if(open=confirm('打开这个网站么?')) { 这个open可以去掉,我都不知道他干嘛用的?还有单等是赋值,双等才是比较2. if(url=='http://www.imooc.com'){ 人家是说通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/ 你这个是就只能打开慕课网,其他都打不开有毛用。要写成if(url!=null)3. alert( window.open("http://www.imooc.com",'_blank','wi...
2017-01-18