如果文本区域为空,我如何包括跨度 [英] How I A Section If Text Area Is Empty Include The Span

查看:43
本文介绍了如果文本区域为空,我如何包括跨度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(document).ready(function () {
    $('textarea').each(function (i, e) {
        if (!$(e).val()) {
            $(e).parent("div").addClass("empty");
        }
        $(e).bind("blur", function () {
            if (!$(this).val()) {
                $(this).parent("div").addClass("empty");
            }
            else {
                $(this).parent("div").removeClass("empty");
            }
        });
    });
});










<div style="BackGround-Color: #FFFFFF">
      <div id='group_g3'>
          <span class="sp" style="font-size: 25px; font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular">text</span>
      </div>
  </div>
  <br />
  <div id="pastObstetric">
      <div id="abortBirth">
          <div id='que_q1g3'>
              <label><b>text:</b></label>
              <input type='radio' name='NUMQ1G3' id='OPT_A1Q1G3' value='1' />
              text
              <span>/</span>
              <input type='radio' name='NUMQ1G3' id='OPT_A2Q1G3' value='2' />
              text
          </div>
          <div id='que_q2g3'>
              <label><b>text:</b></label>
              <textarea id='TXT_A1Q2G3' style='OVERFLOW: visible; TEXT-OVERFLOW: ellipsis; WORD-WRAP: break-word' name='TXTA1Q2G3' rows='1' cols='34' tabindex='7' onfocus="fnSet('TXT_A1Q2G3')"></textarea>
          </div>













i想要打印前检查如果textarea是空的,如果没有显示任何文本区域为空隐藏标签和标题跨度







i want to check before printing if textarea is empty if not its show if any text area is empty hide the label and the title span

推荐答案

(文件).ready(function() {
(document).ready(function () {


' textarea')。each(function( i,e){
if (!
('textarea').each(function (i, e) { if (!


(e).val()){
(e).val()) {


这篇关于如果文本区域为空,我如何包括跨度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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