一个HTML中的的多选框问题

js在选取option下拉框id=day的项目,触发显示新的下拉多选框,多选框在整个父元素div之中无法得到期待的效果

尝试了在div父元素中的select直接赋予mutiple或者是添加div和ul元素链接js mouseleave等等函数表现都有问题。

img

目的是在"休息"的选项中选中id=day的同时在红色区域内显示html的多选下拉框,关系代码如下

<div class="inputBlock">
      <div class="subject">
        <h2>关闭h2>
        <span class="require">关闭span>
      div>
      <div class="formBox">
        <div class="inner{{ $errors->hasAny('shop_open', 'shop_close') ? ' error' : '' }}">
          <div class="answerBox section">
            <label data-inline="true">
              <input type="checkbox" name="all_day_time" id="all_day_time" data-mini="true" value="on" {{ is_checked('all_day_time', 'on', $merchant->all_day_time) ? 'checked' : '' }}/>关闭
            label>
            <div class="section">
              @php ($startTime = \Carbon\Carbon::createFromTime('00', '00'))
              @php ($endTime = \Carbon\Carbon::createFromTime('24', '00'))
              <div data-role="fieldcontain" class="section">
                <label for="business_open_time">
                  <span class="inputType">关闭span>
                label>
                <select name="business_open_time" id="business_open_time" data-inline="true" required>
                  <option value="">关闭option>
                  @while ($startTime->diffInMinutes($endTime))
                    <option value="{{ $startTime->format('G:i') }}"{{ (!empty(old('business_open_time', $merchant->open_time)) && old('business_open_time', $merchant->open_time) == $startTime->format('G:i')) ? ' selected="selected"' : '' }}>{{ $startTime->format('G:i') }}option>
                    @php ($startTime->addMinutes(30))
                  @endwhile
                select>
                @if ($errors->has('business_open_time'))
                  @foreach ($errors->get('business_open_time') as $error)
                    <p class="errorMessage">{{ $error }}p>
                  @endforeach
                @endif
              div>
              <div data-role="fieldcontain" class="section">
                <label for="business_finish_time">
                  <span class="inputType">开启span>
                label>
                <select name="business_finish_time" id="business_finish_time" data-inline="true" required >
                  <option value="">开启option>
                  @php ($startTime = \Carbon\Carbon::createFromTime('00', '00'))
                  @while ($startTime->diffInMinutes($endTime))
                    <option value="{{ $startTime->format('G:i') }}"{{ (!empty(old('business_finish_time', $merchant->close_time)) && old('business_finish_time', $merchant->close_time) == $startTime->format('G:i')) ? ' selected="selected"' : '' }}>{{ $startTime->format('G:i') }}option>
                    @php ($startTime->addMinutes(30))
                  @endwhile
                select>
                @if ($errors->has('business_finish_time'))
                  @foreach ($errors->get('business_finish_time') as $error)
                    <p class="errorMessage">{{ $error }}p>
                  @endforeach
                @endif
              div>
              <div data-role="fieldcontain" class="section">
                <label for="shop_close">
                  <span class="inputType">休息span>
                label>
                <select name="shop_close" id="shop_close" data-inline="true" required>
                  <option>休息option>
                  <option {{old('shop_close', $appPayMerchant->regular_holiday) == "一" ? " selected" : ""}}>option>
                  <option {{old('shop_close', $appPayMerchant->regular_holiday) == "一" ? " selected" : ""}}>option>
                  <option {{old('shop_close', $appPayMerchant->regular_holiday) == "一" ? " selected" : ""}}>option>
                  <option {{old('shop_close', $appPayMerchant->regular_holiday) == "一" ? " selected" : ""}}>option>
                  <option id="day" {{old('shop_close', $appPayMerchant->regular_holiday) == "二" ? " selected" : ""}}>option>
                  <option id="day"  {{old('shop_close', $appPayMerchant->regular_holiday) == "二" ? " selected" : ""}}>option>
                  <option id="day"  {{old('shop_close', $appPayMerchant->regular_holiday) == "二" ? " selected" : ""}}>option>
                  <option id="day"  {{old('shop_close', $appPayMerchant->regular_holiday) == "二" ? " selected" : ""}}>option>
                  <option id="day"  {{old('shop_close', $appPayMerchant->regular_holiday) == "二" ? " selected" : ""}}>option>
                  <option id="day" {{old('shop_close', $appPayMerchant->regular_holiday) == "二" ? " selected" : ""}}>option>
                select>
                @if ($errors->has('shop_close'))
                  @foreach ($errors->get('shop_close') as $error)
                    <p class="errorMessage">{{ $error }}p>
                  @endforeach
                @endif
              div>
            div>
            <div class="errorMsg">div>
            @include('merchant/form/rpay_openday_notes')
          div>
        div>
      div>
      
    


还请指教在此情况下如何调出有效的多选框,非常感谢!!

id为day的option有多个,只要是id是day就显示?要显示哪个dom对象?

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632