function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className = "two";
}
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className = "two";
}
2019-01-04
function hidetext()
{
var mychar = document.getElementById("con");
mychar.style.display = "none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display = "block";
}
{
var mychar = document.getElementById("con");
mychar.style.display = "none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display = "block";
}
2019-01-04
最新回答 / 木子955
<script>var answer = confirm("是否要打开新窗口?");var newHeight = window.screen.height/2;var newWidth = window.scree.width/2;if(answer){ window.open("http://www.imooc.com","_blank","width=newWidth,height=newHeight");}</script>
2019-01-04
var mychar= document.getElementById("con") ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML = "Hello world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML = "Hello world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
2019-01-04
function openWindow() {
var myClick = confirm("点击了按钮");
if(myClick==true) {
var url = prompt("确定打开网址",'http://www.imooc.com/')
if(url!=null) {
window.open(url,'_blank','width=400,height=0,menubar=no,toolbar=no');
}
}else {
alert("取消点击");
}
}
var myClick = confirm("点击了按钮");
if(myClick==true) {
var url = prompt("确定打开网址",'http://www.imooc.com/')
if(url!=null) {
window.open(url,'_blank','width=400,height=0,menubar=no,toolbar=no');
}
}else {
alert("取消点击");
}
}
最新回答 / showmylifeqwe11
<!DOCTYPE html><html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openWindow(){ // 新窗口打开时弹出确...
2019-01-04
function openWindow(){
var newWindow = confirm("是否打开新窗口?");
if(newWindow==true){
var uno = window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');
}else{}
};
var newWindow = confirm("是否打开新窗口?");
if(newWindow==true){
var uno = window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');
}else{}
};
已采纳回答 / 蓝瑟
我只找到了这2处错误:定义改变宽高的函数里,属性值 300px等等 应该用引号括起来;定义取消设置的函数里,函数名reset可能是什么关键字,不能用做函数名,具体你可以百度一下,换个名字就能实现函数;
2019-01-03
已采纳回答 / 慕瓜6331918
以下是我的代码~~供参考<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" Content="text/html; charset=utf-8" /><title>javascript</title><style type="text/css">body{font-size:12px;}#txt{ height:400px; width:600p...
2019-01-02
已采纳回答 / Wick_L
window.open('http://www.imooc.com','-blank','width=400px,height=500px,menubar=no,toolbar=no') 自己看下哪里错了
2019-01-02
var origninalContent = document.getElementById('con').innerHTML;
document.write('rusult:' + origninalContent + '<br>');
origninalContent = "Hello World";
document.write('resultChange:' + origninalContent);
document.write('rusult:' + origninalContent + '<br>');
origninalContent = "Hello World";
document.write('resultChange:' + origninalContent);
2019-01-01