解决方案 »

  1.   

    input 绑定一个keyup事件  每次输入都判断
      

  2.   


     $("#spell").keyup(function () {
                
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
    <div>
    <input id="spell" title="" name="spell" class="input wide" type="text" />
    </div>
    一点反应都没有 我是用户点击图片我用jquery弹出上面的层 然后用户输入我在对比
      

  3.   

    添加事件的代码放到你的html代码下面了吗?或者放到$(function(){})中,要不绑定不了事件
      

  4.   


     $("#spell").keyup(function () {
                
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
    <div>
    <input id="spell" title="" name="spell" class="input wide" type="text" />
    </div>
    一点反应都没有 我是用户点击图片我用jquery弹出上面的层 然后用户输入我在对比
    有效果啊 你在输入框中输入看看  title先设置个值
      

  5.   

    $(document).ready(function () {
            //内嵌弹出层调用
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 560,
                    bgvisibel: true,
                    title: '单词拼写',
                    html: $("#pingxie").html()
                });
            });
            //iframe弹出层调用
            $('#outside').click(function () {
                $.webox({
                    height: 280,
                    width: 600,
                    bgvisibel: true,
                    title: 'iframe弹出层调用',
                    iframe: 'iframe.html?' + Math.random
                });
            });
            $("#spell").keyup(function () {
                
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
        })
    <a  href="javascript:void(0);" id="inside" style="display:none;"><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div id="div7"></div>
    <div>
    <input id="spell" title="" name="spell" class="input wide" type="text" />
    </div></div>
    放了啊
      

  6.   


     $("#spell").keyup(function () {
                
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
    <div>
    <input id="spell" title="" name="spell" class="input wide" type="text" />
    </div>
    一点反应都没有 我是用户点击图片我用jquery弹出上面的层 然后用户输入我在对比
    有效果啊 你在输入框中输入看看  title先设置个值
    你看看我6楼的代码 点击单词拼写弹出pingxie层 用户在pingxie里的文本框输入值我调用keyup判断 title赋了值也没用 试过了
      

  7.   

    <html>
    <head>
    <script type="text/javascript" src="/jquery/jquery.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
      
      $("#spell").keyup(function(){
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
      });
    });
    </script>
    </head>
    <body>
    Enter your name: <input id="spell" title="123" name="spell" class="input wide" type="text" />
    <p>当发生 keydown 和 keyup 事件时,输入域会改变颜色。请试着在其中输入内容。</p>
    </body>
    </html>这样子就不会有问题
      

  8.   


     $("#spell").keyup(function () {
                
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
    <div>
    <input id="spell" title="" name="spell" class="input wide" type="text" />
    </div>
    一点反应都没有 我是用户点击图片我用jquery弹出上面的层 然后用户输入我在对比
    有效果啊 你在输入框中输入看看  title先设置个值
    你看看我6楼的代码 点击单词拼写弹出pingxie层 用户在pingxie里的文本框输入值我调用keyup判断 title赋了值也没用 试过了貌似你这个弹出层 是另一个页面了 
    你把事件绑定的代码放在弹出层里看看
      

  9.   


     $("#spell").keyup(function () {
                
                var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
    <div>
    <input id="spell" title="" name="spell" class="input wide" type="text" />
    </div>
    一点反应都没有 我是用户点击图片我用jquery弹出上面的层 然后用户输入我在对比
    有效果啊 你在输入框中输入看看  title先设置个值
    你看看我6楼的代码 点击单词拼写弹出pingxie层 用户在pingxie里的文本框输入值我调用keyup判断 title赋了值也没用 试过了貌似你这个弹出层 是另一个页面了 
    你把事件绑定的代码放在弹出层里看看不行啊 放在弹出层里连jquery代码都不显示了
      

  10.   

    <script type="text/javascript" src="{config.templateskin}/js/jquery-webox.js"></script>
    <script type="text/javascript">
        
        $(document).ready(function () {
           
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });        
            $("#spell").keyup(function () {            var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
        })
        </script>
    </head>
    <body>
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text" />
    </div>
    </div>
    </body>jquery-webox.js 代码$.extend({
    webox:function(option){
    var _x,_y,m,allscreen=false;
    if(!option){
    alert('options can\'t be empty');
    return;
    };
    if(!option['html']&&!option['iframe']){
    alert('html attribute and iframe attribute can\'t be both empty');
    return;
    };
    option['parent']='webox';
    option['locked']='locked';
    $(document).ready(function(e){
    $('.webox').remove();
    $('.background').remove();
    var width=option['width']?option['width']:400;
    var height=option['height']?option['height']:240;
                $('body').append('<script type="text/javascript" src="/templates/green/js/base.js"></script>');
    $('body').append('<div class="background" style="display:none;"></div><div class="webox" style="width:'+width+'px;height:'+height+'px;display:none;"><div id="inside" style="height:'+height+'px;"><h1 id="locked" onselectstart="return false;">'+(option['title']?option['title']:'webox')+'<a class="span" href="javascript:void(0);"></a></h1>'+(option['iframe']?'<iframe class="w_iframe" src="'+option['iframe']+'" frameborder="0" width="100%" scrolling="yes" style="border:none;overflow-x:hidden;height:'+parseInt(height-30)+'px;"></iframe>':option['html']?option['html']:'')+'</div></div>');
    if(navigator.userAgent.indexOf('MSIE 7')>0||navigator.userAgent.indexOf('MSIE 8')>0){
    $('.webox').css({'filter':'progid:DXImageTransform.Microsoft.gradient(startColorstr=#55000000,endColorstr=#55000000)'});
    }if(option['bgvisibel']){
    $('.background').fadeTo('slow',0.3);
    };
    $('.webox').css({display:'block'});
    $('#'+option['locked']+' .span').click(function(){
    $('.webox').css({display:'none'});
    $('.background').css({display:'none'});
    });
    var marginLeft=parseInt(width/2);
    var marginTop=parseInt(height/2);
    var winWidth=parseInt($(window).width()/2);
    var winHeight=parseInt($(window).height()/2.2);
    var left=winWidth-marginLeft;
    var top=winHeight-marginTop;
    $('.webox').css({left:left,top:top});
    $('#'+option['locked']).mousedown(function(e){
    if(e.which){
    m=true;
    _x=e.pageX-parseInt($('.webox').css('left'));
    _y=e.pageY-parseInt($('.webox').css('top'));
    }
    }).dblclick(function(){
    if(allscreen){
    $('.webox').css({height:height,width:width});
    $('#inside').height(height);
    $('.w_iframe').height(height-30);
    $('.webox').css({left:left,top:top});
    allscreen = false;
    }else{
    allscreen=true;
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();$
    ('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }).mousemove(function(e){
    if(m && !allscreen){
    var x=e.pageX-_x;
    var y=e.pageY-_y;
    $('.webox').css({left:x});
    $('.webox').css({top:y});
    }
    }).mouseup(function(){
    m=false;
    });
    $(window).resize(function(){
    if(allscreen){
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();
    $('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }
    });我弹出的DIV也是在同一个页面里啊 为什么没有办法调用keyup方法呢? 调试根本就没执行keyup方法 是不是html: $("#pingxie").html()写的有问题呢。大家帮我看看吧
      

  11.   

    <script type="text/javascript" src="{config.templateskin}/js/jquery-webox.js"></script>
    <script type="text/javascript">
        
        $(document).ready(function () {
           
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });        
            $("#spell").keyup(function () {            var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
        })
        </script>
    </head>
    <body>
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text" />
    </div>
    </div>
    </body>jquery-webox.js 代码$.extend({
    webox:function(option){
    var _x,_y,m,allscreen=false;
    if(!option){
    alert('options can\'t be empty');
    return;
    };
    if(!option['html']&&!option['iframe']){
    alert('html attribute and iframe attribute can\'t be both empty');
    return;
    };
    option['parent']='webox';
    option['locked']='locked';
    $(document).ready(function(e){
    $('.webox').remove();
    $('.background').remove();
    var width=option['width']?option['width']:400;
    var height=option['height']?option['height']:240;
                $('body').append('<script type="text/javascript" src="/templates/green/js/base.js"></script>');
    $('body').append('<div class="background" style="display:none;"></div><div class="webox" style="width:'+width+'px;height:'+height+'px;display:none;"><div id="inside" style="height:'+height+'px;"><h1 id="locked" onselectstart="return false;">'+(option['title']?option['title']:'webox')+'<a class="span" href="javascript:void(0);"></a></h1>'+(option['iframe']?'<iframe class="w_iframe" src="'+option['iframe']+'" frameborder="0" width="100%" scrolling="yes" style="border:none;overflow-x:hidden;height:'+parseInt(height-30)+'px;"></iframe>':option['html']?option['html']:'')+'</div></div>');
    if(navigator.userAgent.indexOf('MSIE 7')>0||navigator.userAgent.indexOf('MSIE 8')>0){
    $('.webox').css({'filter':'progid:DXImageTransform.Microsoft.gradient(startColorstr=#55000000,endColorstr=#55000000)'});
    }if(option['bgvisibel']){
    $('.background').fadeTo('slow',0.3);
    };
    $('.webox').css({display:'block'});
    $('#'+option['locked']+' .span').click(function(){
    $('.webox').css({display:'none'});
    $('.background').css({display:'none'});
    });
    var marginLeft=parseInt(width/2);
    var marginTop=parseInt(height/2);
    var winWidth=parseInt($(window).width()/2);
    var winHeight=parseInt($(window).height()/2.2);
    var left=winWidth-marginLeft;
    var top=winHeight-marginTop;
    $('.webox').css({left:left,top:top});
    $('#'+option['locked']).mousedown(function(e){
    if(e.which){
    m=true;
    _x=e.pageX-parseInt($('.webox').css('left'));
    _y=e.pageY-parseInt($('.webox').css('top'));
    }
    }).dblclick(function(){
    if(allscreen){
    $('.webox').css({height:height,width:width});
    $('#inside').height(height);
    $('.w_iframe').height(height-30);
    $('.webox').css({left:left,top:top});
    allscreen = false;
    }else{
    allscreen=true;
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();$
    ('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }).mousemove(function(e){
    if(m && !allscreen){
    var x=e.pageX-_x;
    var y=e.pageY-_y;
    $('.webox').css({left:x});
    $('.webox').css({top:y});
    }
    }).mouseup(function(){
    m=false;
    });
    $(window).resize(function(){
    if(allscreen){
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();
    $('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }
    });我弹出的DIV也是在同一个页面里啊 为什么没有办法调用keyup方法呢? 调试根本就没执行keyup方法 是不是html: $("#pingxie").html()写的有问题呢。大家帮我看看吧在19行后面加上keyup事件看看
      

  12.   

    <script type="text/javascript" src="{config.templateskin}/js/jquery-webox.js"></script>
    <script type="text/javascript">
        
        $(document).ready(function () {
           
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });        
            $("#spell").keyup(function () {            var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
        })
        </script>
    </head>
    <body>
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text" />
    </div>
    </div>
    </body>jquery-webox.js 代码$.extend({
    webox:function(option){
    var _x,_y,m,allscreen=false;
    if(!option){
    alert('options can\'t be empty');
    return;
    };
    if(!option['html']&&!option['iframe']){
    alert('html attribute and iframe attribute can\'t be both empty');
    return;
    };
    option['parent']='webox';
    option['locked']='locked';
    $(document).ready(function(e){
    $('.webox').remove();
    $('.background').remove();
    var width=option['width']?option['width']:400;
    var height=option['height']?option['height']:240;
                $('body').append('<script type="text/javascript" src="/templates/green/js/base.js"></script>');
    $('body').append('<div class="background" style="display:none;"></div><div class="webox" style="width:'+width+'px;height:'+height+'px;display:none;"><div id="inside" style="height:'+height+'px;"><h1 id="locked" onselectstart="return false;">'+(option['title']?option['title']:'webox')+'<a class="span" href="javascript:void(0);"></a></h1>'+(option['iframe']?'<iframe class="w_iframe" src="'+option['iframe']+'" frameborder="0" width="100%" scrolling="yes" style="border:none;overflow-x:hidden;height:'+parseInt(height-30)+'px;"></iframe>':option['html']?option['html']:'')+'</div></div>');
    if(navigator.userAgent.indexOf('MSIE 7')>0||navigator.userAgent.indexOf('MSIE 8')>0){
    $('.webox').css({'filter':'progid:DXImageTransform.Microsoft.gradient(startColorstr=#55000000,endColorstr=#55000000)'});
    }if(option['bgvisibel']){
    $('.background').fadeTo('slow',0.3);
    };
    $('.webox').css({display:'block'});
    $('#'+option['locked']+' .span').click(function(){
    $('.webox').css({display:'none'});
    $('.background').css({display:'none'});
    });
    var marginLeft=parseInt(width/2);
    var marginTop=parseInt(height/2);
    var winWidth=parseInt($(window).width()/2);
    var winHeight=parseInt($(window).height()/2.2);
    var left=winWidth-marginLeft;
    var top=winHeight-marginTop;
    $('.webox').css({left:left,top:top});
    $('#'+option['locked']).mousedown(function(e){
    if(e.which){
    m=true;
    _x=e.pageX-parseInt($('.webox').css('left'));
    _y=e.pageY-parseInt($('.webox').css('top'));
    }
    }).dblclick(function(){
    if(allscreen){
    $('.webox').css({height:height,width:width});
    $('#inside').height(height);
    $('.w_iframe').height(height-30);
    $('.webox').css({left:left,top:top});
    allscreen = false;
    }else{
    allscreen=true;
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();$
    ('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }).mousemove(function(e){
    if(m && !allscreen){
    var x=e.pageX-_x;
    var y=e.pageY-_y;
    $('.webox').css({left:x});
    $('.webox').css({top:y});
    }
    }).mouseup(function(){
    m=false;
    });
    $(window).resize(function(){
    if(allscreen){
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();
    $('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }
    });我弹出的DIV也是在同一个页面里啊 为什么没有办法调用keyup方法呢? 调试根本就没执行keyup方法 是不是html: $("#pingxie").html()写的有问题呢。大家帮我看看吧在19行后面加上keyup事件看看
    具体要怎么加 我初学jquery不是很懂你的意思 我17行不是已经加了keyup事件了吗?只要不是弹出层就不会有问题
      

  13.   

    <script type="text/javascript" src="{config.templateskin}/js/jquery-webox.js"></script>
    <script type="text/javascript">
        
        $(document).ready(function () {
           
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });        
            $("#spell").keyup(function () {            var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
        })
        </script>
    </head>
    <body>
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text" />
    </div>
    </div>
    </body>jquery-webox.js 代码$.extend({
    webox:function(option){
    var _x,_y,m,allscreen=false;
    if(!option){
    alert('options can\'t be empty');
    return;
    };
    if(!option['html']&&!option['iframe']){
    alert('html attribute and iframe attribute can\'t be both empty');
    return;
    };
    option['parent']='webox';
    option['locked']='locked';
    $(document).ready(function(e){
    $('.webox').remove();
    $('.background').remove();
    var width=option['width']?option['width']:400;
    var height=option['height']?option['height']:240;
                $('body').append('<script type="text/javascript" src="/templates/green/js/base.js"></script>');
    $('body').append('<div class="background" style="display:none;"></div><div class="webox" style="width:'+width+'px;height:'+height+'px;display:none;"><div id="inside" style="height:'+height+'px;"><h1 id="locked" onselectstart="return false;">'+(option['title']?option['title']:'webox')+'<a class="span" href="javascript:void(0);"></a></h1>'+(option['iframe']?'<iframe class="w_iframe" src="'+option['iframe']+'" frameborder="0" width="100%" scrolling="yes" style="border:none;overflow-x:hidden;height:'+parseInt(height-30)+'px;"></iframe>':option['html']?option['html']:'')+'</div></div>');
    if(navigator.userAgent.indexOf('MSIE 7')>0||navigator.userAgent.indexOf('MSIE 8')>0){
    $('.webox').css({'filter':'progid:DXImageTransform.Microsoft.gradient(startColorstr=#55000000,endColorstr=#55000000)'});
    }if(option['bgvisibel']){
    $('.background').fadeTo('slow',0.3);
    };
    $('.webox').css({display:'block'});
    $('#'+option['locked']+' .span').click(function(){
    $('.webox').css({display:'none'});
    $('.background').css({display:'none'});
    });
    var marginLeft=parseInt(width/2);
    var marginTop=parseInt(height/2);
    var winWidth=parseInt($(window).width()/2);
    var winHeight=parseInt($(window).height()/2.2);
    var left=winWidth-marginLeft;
    var top=winHeight-marginTop;
    $('.webox').css({left:left,top:top});
    $('#'+option['locked']).mousedown(function(e){
    if(e.which){
    m=true;
    _x=e.pageX-parseInt($('.webox').css('left'));
    _y=e.pageY-parseInt($('.webox').css('top'));
    }
    }).dblclick(function(){
    if(allscreen){
    $('.webox').css({height:height,width:width});
    $('#inside').height(height);
    $('.w_iframe').height(height-30);
    $('.webox').css({left:left,top:top});
    allscreen = false;
    }else{
    allscreen=true;
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();$
    ('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }).mousemove(function(e){
    if(m && !allscreen){
    var x=e.pageX-_x;
    var y=e.pageY-_y;
    $('.webox').css({left:x});
    $('.webox').css({top:y});
    }
    }).mouseup(function(){
    m=false;
    });
    $(window).resize(function(){
    if(allscreen){
    var screenHeight = $(window).height();
    var screenWidth = $(window).width();
    $('.webox').css({'width':screenWidth-18,'height':screenHeight-18,'top':'0px','left':'0px'});
    $('#inside').height(screenHeight-20);
    $('.w_iframe').height(screenHeight-50);
    }
    });
    }
    });我弹出的DIV也是在同一个页面里啊 为什么没有办法调用keyup方法呢? 调试根本就没执行keyup方法 是不是html: $("#pingxie").html()写的有问题呢。大家帮我看看吧在19行后面加上keyup事件看看
    具体要怎么加 我初学jquery不是很懂你的意思 我17行不是已经加了keyup事件了吗?只要不是弹出层就不会有问题加在这个文件里jquery-webox.js 
    $('body').append()源文件里在这加了一大段html代码 应该就是弹出层的html
    你把事件绑定放到这里试下看看  我也不知道对不对
      

  14.   

    19行里的base.js里面写的就是keyup方法 还是不行啊
      

  15.   

    $('body').append('<div class="background" style="display:none;"></div><div class="webox" style="width:' + width + 'px;height:' + height + 'px;display:none;"><div id="inside" style="height:' + height + 'px;"><h1 id="locked" onselectstart="return false;">' + (option['title'] ? option['title'] : 'webox') + '<a class="span" href="javascript:void(0);"></a></h1>' + (option['iframe'] ? '<iframe class="w_iframe" src="' + option['iframe'] + '" frameborder="0" width="100%" scrolling="yes" style="border:none;overflow-x:hidden;height:' + parseInt(height - 30) + 'px;"></iframe>' : option['html'] ? option['html'] : '') + '</div></div>');
    $("#spell").bind("keyup", function () {
        var aaa = $("#spell").attr("title");
        var bbb = $("#spell").attr("value");
        if (aaa == bbb) {
            alert("相同");
        }
        else {
            alert("不同");
        }
    });
    这样也不对
      

  16.   

    我只想在弹出层里调用keyup方法判断一下值是否正确
      

  17.   

     function upperCase() {
            var aaa = $("#spell").attr("title");
            var bbb = $("#spell").val();
            if (aaa == bbb) {
                alert("相同");
            }
            else {
                alert("不同");
            }
        }
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text" onkeyup="upperCase()"/>
    <div id="aaa"></div>
    </div>
    </div>这样写可以了 但是var bbb = $("#spell").val();老是取不到文本框的值
      

  18.   


    <script type="text/javascript" src="{config.templateskin}/js/jquery-webox.js"></script>
    <script type="text/javascript">
        
        $(document).ready(function () {
           
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });        
            $("#spell").keyup(function () {            var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
        })
        </script>
    </head>
    <body>
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text" />
    </div>
    </div>
    </body>将你的input标签的id换成class,
    $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });这个调用里面的html后面改为:$("#pingxie").clone();这个键盘事件#改为.就可以了
    $("#spell").keyup(function () {            var aaa = $("#spell").attr("title");
                var bbb = $("#spell").attr("value");
                if (aaa == bbb) {
                    alert("相同");
                }
                else {
                    alert("不同");
                }
            });
      

  19.   


    不行的话,你就等到把键盘事件加到 $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
                //将键盘事件放到这里试下
               $(".spell").keyup(function(){
                    //code
                })        });
        
      

  20.   

    成功了 
    <script type="text/javascript">
        
        $(document).ready(function () {
           
            $('#inside').click(function () {
                $.webox({
                    height: 188,
                    width: 400,
                    bgvisibel: true,
                    title: '内嵌弹出层调用',
                    html: $("#pingxie").html()
                });
            });            })
        function upperCase(obj) {
            var aaa = $("#spell").attr("title");
            var bbb = obj.value;
            if (aaa == bbb) {
                $(".div1").text("输入正确");
            }
            else {            $(".div1").text("错误");        }
        }
        </script>
    </head>
    <body>
    <a  href="javascript:void(0);" id="inside" ><strong>单词拼写</strong></a>
    <div id="div2"></div>
    <div id="pingxie" style="display:none;">
     <div>
    <input id="spell" title="123" name="spell" class="input wide" type="text"  onkeyup="upperCase(this)"/>
    <div  class="div1"></div></div>
    </div>
    </body>
    </html>
    我通过id给div1赋值,$("#div1").text("...");赋值不上去,后来我试着按照wzb0712说的 把id换成class,居然成功了,虽然成功了但还是不知道为什么
      

  21.   

    id是唯一的,一个页面不能同时出现多个相同的id