function openWindow( ){ if(confirm('确认打开新网页?'){window.open('http://www.imooc.com', '_blank', width = 400, height = 500)}else{return false}
正确代码
function openWindow()
{
var newButton=confirm("打开");
if(newButton==true)
{
var url="http://www.imooc.com/";
var qd=prompt("打开网址",url);
if(qd{window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');}else{} } }
function openWindow()
{
var newButton=confirm("打开");
if(newButton==true)
{
var url="http://www.imooc.com/";
var qd=prompt("打开网址",url);
if(qd{window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');}else{} } }
window.open('http://www.imooc.com','_blank','width=300','height=400','top=100','left=0')是这样吧
2019-01-16
题目上写的是宽600,高400,那应该是width=600 height=400才对
结果答案验证的却是width=400 height=600 反过来了???
……大坑
结果答案验证的却是width=400 height=600 反过来了???
……大坑
2019-01-14
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
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