var message=comfirm("Are you ok?");
if(message==true)
{
document.write("ok");
}
else
{
document.write("no");
}
if(message==true)
{
document.write("ok");
}
else
{
document.write("no");
}
2016-08-22
<script type="text/javascript">
var mychar = document.getElementById('txt');
//"改变颜色"
function red01 (){
mychar.style.color='red';
muchar.style.backgroundColo = '#CCC';
}
//"改变宽高"
function wl001 () {
mychar.style.width= '600px';
mychar.style.height ='300px';
}
var mychar = document.getElementById('txt');
//"改变颜色"
function red01 (){
mychar.style.color='red';
muchar.style.backgroundColo = '#CCC';
}
//"改变宽高"
function wl001 () {
mychar.style.width= '600px';
mychar.style.height ='300px';
}
<input name="button" type="button" onClick="h001()" value="隐藏内容" >
<input name="button" type="button" onClick="di001()" value="显示内容" >
<input name="button" type="button" onClick="cal01()" value="取消设置" >
</form>
<input name="button" type="button" onClick="di001()" value="显示内容" >
<input name="button" type="button" onClick="cal01()" value="取消设置" >
</form>
新套路:
var mychar= document.getElementById("con").style;
mychar.color='red'
mychar.backgroundColor='#ccc'
mychar.width='300px'
var mychar= document.getElementById("con").style;
mychar.color='red'
mychar.backgroundColor='#ccc'
mychar.width='300px'
2016-08-22
function rec(){
var mymessage=confirm("你真的没看过av吗?说谎断小鸡鸡哦!") ;
if(mymessage==true)
{
document.write("你是女士!");
}
else
{
document.write("你是男士!");
}
}
var mymessage=confirm("你真的没看过av吗?说谎断小鸡鸡哦!") ;
if(mymessage==true)
{
document.write("你是女士!");
}
else
{
document.write("你是男士!");
}
}
2016-08-22
function openWindow(){
var a=confirm("是否打开");
if(a==1){
b=prompt("确定打开的网址:","http://www.imooc.com/");
window.open(b,"_blank",'width=400,height=500,menubar=no,toolbar=no');}
}
就我这代码……后面点了取消也打开网址……,看到下面的一堆评论的代码,好像和我的差不多,就只有我发现这个问题吗……
var a=confirm("是否打开");
if(a==1){
b=prompt("确定打开的网址:","http://www.imooc.com/");
window.open(b,"_blank",'width=400,height=500,menubar=no,toolbar=no');}
}
就我这代码……后面点了取消也打开网址……,看到下面的一堆评论的代码,好像和我的差不多,就只有我发现这个问题吗……
function openWindow()
{
var temp=confirm("是否打开新窗口");
if(temp == true) {
//document.write("aaa");
window.open(prompt('请输入','http://www.imooc.com/'),'_blank','width=400,height=500,menubar=no,toolbar=no');
}
else
{}
}
{
var temp=confirm("是否打开新窗口");
if(temp == true) {
//document.write("aaa");
window.open(prompt('请输入','http://www.imooc.com/'),'_blank','width=400,height=500,menubar=no,toolbar=no');
}
else
{}
}