0

クラス .removeRow の div でボタンを「見つけた」後に、alertify.js を使用したい

  $(".removeRow").find("button").click(function(){
            alertify.confirm("remove this field?", function (e) {
                if (e) {
                    // user clicked "ok"
                    $(this).closest(".agrRow").remove();
                }
            });     
  });

問題は、アラートを呼び出した後、「これ」の値を失うことです。「これ」をアラート機能に渡すにはどうすればよいですか?

4

1 に答える 1

4
$(".removeRow").find("button").click(function(){
    var temp = this;
    alertify.confirm("remove this field?", function (e) {
        if (e) {
            // user clicked "ok"
            $(temp).closest(".agrRow").remove();
        }
    });     
});
于 2014-10-21T19:10:16.127 に答える