<td colspan="3" id="eventypetd"><select  id="eventype"></select></td>
$('#eventypetd').append(" 比例:<input type='text'  id='bili' />");
当select变动时删除    比例:<input type='text'  id='bili' />应怎么写?

解决方案 »

  1.   

    删除 <td>下  除 id=eventype 的所有子节点怎么写?
      

  2.   

    $("select").change(function(){
    var temp = $(this);
    $(this).parent().empty().append(temp);
    });
      

  3.   

    var vpa='<span id="spbili">比例:<input type="text" id="bili" /></span>'$('#eventypetd').append(vpa)在select的onchange时间中写
    $('#spbili').remove()
      

  4.   


    这些节点都给个class="abc"然后 $('.abc').remove()
      

  5.   

    要用到2个方法  change()  和 remove(); $( function() {
    $("#eventype").change( function(){     $("#bili").remove();})
    })如果 还需要判断 SELECT 改变的值  只需要加上判断就可以了
    $( function() {
    $("#eventype").change( function(){
          if($("#eventype").val()==1){
         $("#bili").remove();
    }})
    })
      

  6.   

    搞错没看见 id=eventype 不删除
    $("select").change(function(){
    var temp = $(this).attr("id");
    if(temp!=eventype){
    $(this).remove()
    }
    });
    这样不晓得行不