1:不是很明白!只要取到文本框里输入的值就可以拉!
2:采用confirm("真的要这样吗?")==true就可以产生类似效果!

解决方案 »

  1.   

    1,
    var s= document.formname.textname.value2,
    if(confirm("ok?")) alert("ok")
    else
    alert("cancel")
      

  2.   

    1.
    <input name=test type=text>var myVar = document.all.test.value;2.function clk(){
    if(confirm("Are u sure?")){
    do something
    }
    else{
    do 
    }
    }
      

  3.   

    1,
    var s= window.prompt("请输入:")
      

  4.   

    if(confirm("真的要这样作嘛?")==true){

    else{
    }
      

  5.   

    同意jxwangzhigang(一棵草),例子如下
    <script>
    para=null;
    function ask()
    {
    if(confirm("do u want to go there?"))
    location.href="myjsp.jsp";
    else
    alert("ok");
    }
    function set(obj)
    {
    para=obj.value;
    alert(para);
    }
    </script>
    <input type=text onblur=set(this)>
    <input type=button onclick=ask()>
      

  6.   

    <script>
    var s= window.prompt("请输入:")
    alert("你输入的是:"+s)
    </script>
      

  7.   

    不好意思,刚刚看到一棵草写的,不想post时,又有好多高手来了,大家已经说得全了