<!DOCTYPE HTML>
<html>
<head>
<title>js</title>
</head>
<body>
<script type="text/javascript">
document.write("helo");
document.getElementById("p1").style.color="blue";
</script>
</body>
</html>
<html>
<head>
<title>js</title>
</head>
<body>
<script type="text/javascript">
document.write("helo");
document.getElementById("p1").style.color="blue";
</script>
</body>
</html>
2016-03-10
function openWindow(){
if(confirm("是否打开新窗口?")){
var url=prompt("要打开的网站:");
console.log(url);
if(url!=null){
window.open(url,'width=400','height=500',"_blank","menubar=no","toolbar=no");
}else{
window.open('http://www.qq.com',"_blank","menubar=no","toolbar=no");
}
}
}
if(confirm("是否打开新窗口?")){
var url=prompt("要打开的网站:");
console.log(url);
if(url!=null){
window.open(url,'width=400','height=500',"_blank","menubar=no","toolbar=no");
}else{
window.open('http://www.qq.com',"_blank","menubar=no","toolbar=no");
}
}
}
已采纳回答 / 慕圣2639889
<!DOCTYPE html><html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openWindow() { var queren=confir...
2016-03-10
<h2 id="con">javascript课程</h2>
<input type="button" value="改变宽高" onClick="cwh()" />
<script>
var con=document.getElementById("con");
//定义“改变宽高”的函数
function cwh() {
con.style.width="200";
con.style.height="300";
}
</script>
<input type="button" value="改变宽高" onClick="cwh()" />
<script>
var con=document.getElementById("con");
//定义“改变宽高”的函数
function cwh() {
con.style.width="200";
con.style.height="300";
}
</script>
最新回答 / 丶大和小
function chongzhi(){ var chongzhi=confirm("是否重置"); if(chongzhi==true){ obj.style.height="400px"; obj.style.width="600px"; obj.style.border="#333 solid 1px"; obj.style.padding="5px"; obj.style.background="white"; obj.style.color="bl...
2016-03-10
已采纳回答 / weibo_玥玥说她不叫玥玥_0
var url = prompt("通过对话框,确认打开的网址","http://www.imooc.com");这句中的逗号你用了中文格式,改成英文的就可以了
2016-03-10
score =prompt("请输入你的成绩:","80");
2016-03-10
最新回答 / 我乐意
function cancel(){ var mychar=document.getElementById("txt"); var message=confirm("确定取消所有设置?"); if(message==true){ mychar.removeAttribute("style"); } else{ alert("保留设置"); } }
2016-03-10
function hidetext()
{
var mychar = document.getElementById("con");
document.getElementById("con").style.display = "none";
}
function showtext()
{
var mychar = document.getElementById("con");
document.getElementById("con").style.display = "block";
}
{
var mychar = document.getElementById("con");
document.getElementById("con").style.display = "none";
}
function showtext()
{
var mychar = document.getElementById("con");
document.getElementById("con").style.display = "block";
}
2016-03-10