0

我在页面上有一个操作,用户单击以删除 div。我想要实现的是,当点击发生时,自动更改下拉以显示值并刷新单独的 div 内容。

例如:-

$("a.removeTier").live('click', function() {
    //var tier = $(this).attr('id').match(/\d+$/);
    var tier = $(this).parent().parent().attr('id').match(/\d+$/);
    //Set the drop down to the correct option value. On this action I'd like to mimic a       onChange so the content of another div changes
    $('#tiers').val(tier);
    //Remove the parent div of the link clicked
    $('#tier'+tier).remove();                   
});
4

1 回答 1

1

调用更改方法。

$("a.removeTier").live('click', function() {
    //var tier = $(this).attr('id').match(/\d+$/);
    var tier = $(this).parent().parent().attr('id').match(/\d+$/);
    //Set the drop down to the correct option value. On this action I'd like to mimic a onChange so the content of another div changes
    $('#tiers').val(tier);
    $('#tiers').change();
    //Remove the parent div of the link clicked
    $('#tier'+tier).remove();                   
});
于 2010-09-07T08:51:34.923 回答