在style设置个样式
用document.getElementById找到命名ID
用className把 样式 加到 ID 的元素里
用document.getElementById找到命名ID
用className把 样式 加到 ID 的元素里
2016-02-21
('www.84fp.com,_blank,width=600px,height=400px,top=100px,left=0') 这样也行 参数分开''扩起来 和 合起来 一样的
2016-02-21
function Wopen(){
window.open('www.84fp.com','_blank','width=600px,height=400px,top=100px,left=0')
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="啪啪啪" / >
window.open('www.84fp.com','_blank','width=600px,height=400px,top=100px,left=0')
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="啪啪啪" / >
2016-02-21
最新回答 / qiaoyang
我的理解是prompt中输入的内容会赋值给当前这个变量。你的代码错,判读语句中的变量写错了,写成cab了。改下window.open 语句可以实现打开输入的网址:if(cba==true){window.open(cba, '_blank', 'width=400,height=500,toolbar=no,menubar=no');}这样应该可以了,试试吧。
2016-02-21
score =prompt("你鸡鸡多长啊?") ;
if(score>=18)
{
document.write("你很棒!");
}
else if(score>=16)
{
document.write("不错吆!");
}
else if(score>=14)
{
document.write("勉强能用");
}
else
{
document.write("抱抱,剁了吧");
}
if(score>=18)
{
document.write("你很棒!");
}
else if(score>=16)
{
document.write("不错吆!");
}
else if(score>=14)
{
document.write("勉强能用");
}
else
{
document.write("抱抱,剁了吧");
}
2016-02-21
var mymessage=confirm("刘亦菲女士,请问你愿意嫁给木毅力为妻吗?");
if(mymessage==true)
{
document.write("我愿意");
}
else
{
document.write("我就是愿意");
}
if(mymessage==true)
{
document.write("我愿意");
}
else
{
document.write("我就是愿意");
}
2016-02-21
<script type="text/javascript">
var mychar=document.getElementById("con") ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello World";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
var mychar=document.getElementById("con") ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello World";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
2016-02-21
document.write(mychar+"<br>")
document.write(mystr+mychar+"的忠实粉丝")
在括号后面加 ; 就不再显示区域 显示内容 比较日狗 咋回事
document.write(mystr+mychar+"的忠实粉丝")
在括号后面加 ; 就不再显示区域 显示内容 比较日狗 咋回事
2016-02-21
function openWindow(){
var js =confirm("是否打开");
var je =window.open('http://www.imooc.com/','_blank','width=400px,height=500px,menubar=no,toolbar=no')
if (js ==true){
document.write(je)
}
else{
alert("bye");}}
为什么我点击取消也会既弹出alert又会打开网页。
var js =confirm("是否打开");
var je =window.open('http://www.imooc.com/','_blank','width=400px,height=500px,menubar=no,toolbar=no')
if (js ==true){
document.write(je)
}
else{
alert("bye");}}
为什么我点击取消也会既弹出alert又会打开网页。