日期:2014-05-16 浏览次数:20440 次
$(".time").children("select").change(function(){ var str=""; $(".time").children("select").each(function(){ str+=$(this).val(); //str+=$(this).val()+$(this).attr("title")要改成这个就不行了 }); $("input[name=optime]").val(str); });
<div class="time"> <select id="fWeek" name="fWeek"><option value="周一" title="-">周一</option><option value="周二" title="-">周二</option><option value="周日" title="-">周日</option></select> - <select id="eWeek" name="eWeek"><option value="周四" title=" ">周四</option><option value="周五" title=" ">周五</option><option value="周六" title=" ">周六</option><option value="周日" title=" ">周日</option></select>: <select id="fHour" name="fHour"><option value="6" title=":">6</option><option value="7" title=":">7</option><option value="8" title=":">8</option><option value="9" title=":">9</option><option value="10" title=":">10</option><option value="11" title=":">11</option><option value="12" title=":">12</option><option value="13" title=":">13</option><option value="14" title=":">14</option><option value="15" title=":">15</option><option value="16" title=":">16</option><option value="17" title=":">17</option><option value="18" title=":">18</option><option value="19" title=":">19</option></select><select id="fMin"><option value="00" title=":">00</option><option value="15" title=":">15</option><option value="30" title=":">30</option><option value="45" title=":">45</option></select> - <select id="eHour" name="eHour"><option value="12" title=":">12</option><option value="13" title=":">13</option><option value="14" title=":">14</option><option value="15" title=":">15</option><option value="16" title=":">16</option><option value="17" title=":">17</option><option value="18" title=":">18</option><option value="19" title=":">19</option><option value="20" title=":">20</option><option value="21" title=":">21</option><option value="22" title=":">22</option><option value="23" title=":">23</option><option value="24" title=":">24</option><option value="01" title=":">01</option><option value="02" title=":">02</option><option value="03" title=":">03</option>