input text框和 checkbox 连带被选中的情况

<ul>

  <li>
        <input type="checkbox" value="E" id="q15_5" name="q15[]" />
        <label for="q15_5"> E&nbsp;其他</label>
         <input rel="q15_5" name="q15_5" maxLength="20" class="otherInfo o_w01" type="text" value="dfsd fsd" />
   </li>

</ul>

$(document).ready(function(){

$('ul li .otherInfo').click(function(){
        $('#'+$(this).attr('rel')).attr('checked', true);
    });

  });

focus 写上需要填写的文字的时候:

原文地址:https://www.cnblogs.com/xiaohong/p/2361427.html