jQuery after()重置 [英] jquery reset after()

查看:86
本文介绍了jQuery after()重置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以重置/更新after()元素?不添加其他after()文本.谢谢

is there a way to reset/update an after() element? Not add another after() text. Thank you

推荐答案

也许这会有所帮助.

(要发送的表格为空的控制器功能表格父DIV的服务器输入参数ID,输出为1-true,0 false)

(Controller function for Emptiness of Form to be sent Server Input parameter ID of Form Parent DIV, output is 1-true, 0 false)

 function emptynessCntrl(elementosForControl){
      var controlResult=1;
        $(elementosForControl).find('input').each(function() {
            if($(this).val().trim()===""){
              controlResult=0;
              console.log($(this).attr('id')+' Element is empty');
              $(this).nextAll().remove();
              $(this).after('<div class="err-label">'+$(this).attr('placeholder')+' is empty</div>');
              return controlResult;
              } 
              else{
                $(this).nextAll().remove();
              }        
           });
        return controlResult;
       }

这篇关于jQuery after()重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆