Javascript 动态添加的Html输入页面选项卡按钮不工作

Javascript 动态添加的Html输入页面选项卡按钮不工作,javascript,c#,jquery,html,Javascript,C#,Jquery,Html,我正在将动态HTML内容添加到下面显示的弹出窗口中 $.get(url, function (data) { swal({ title: "", text: data, html: true, showCancelButton: false, showConfirmButton: false, customClass: "dialog", allowOutsideClick:

我正在将动态HTML内容添加到下面显示的弹出窗口中

$.get(url, function (data) {
    swal({
        title: "",
        text: data,
        html: true,
        showCancelButton: false,
        showConfirmButton: false,
        customClass: "dialog",
        allowOutsideClick: true,
        allowEscapeKey: true
    },
    function() {
        console.log('');
    });
这是我的dynamicHtml内容

 @using (Html.BeginForm("GetSendMessagePopUp", "Help", FormMethod.Post, new {enctype = "multipart/form-data", id = "questionModelForm"}))
    {
        <div>
            @Html.TextBoxFor(item => item.FullName, new { style = "display: block"})
        </div>
        <div>            
            @Html.TextBoxFor(item => item.Phone, new {style = "display: block"})
        </div>
        <div>            
            @Html.TextAreaFor(item => item.Message, new {style = "display: block"})
        </div>

        <a href="javascript:void(0)" onclick="sendUserMessage()" class="helpButton">Gönder</a>
    }
</div>

也添加这段代码:

$.ajaxComplete(function () {
  $('.dialog input').tabs();
  $('.dialog input').tabs('refresh');
  // And whatever you wanna load fresh, after the AJAX call is completed.
});

在sweetalert.js中,我对tab键的默认值进行了注释,然后它开始工作良好

// TAB
    if (btnIndex === -1) {
        // No button focused. Jump to the confirm button.
        $targetElement = $okButton;
    } else {
        // Cycle to the next button
        if (btnIndex === $modalButtons.length - 1) {
            $targetElement = $modalButtons[0];
        } else {
            $targetElement = $modalButtons[btnIndex + 1];
        }
    }

    _stopEventPropagation$fireClick.stopEventPropagation(e);
    $targetElement.focus();

    if (params.confirmButtonColor) {
        _setFocusStyle.setFocusStyle($targetElement, params.confirmButtonColor);
    }

我删除了这一行,但效果很好

如果事件应该在生成的html内容上触发,那么您可能需要使用events@AhsN事件可以在任何地方触发,我认为问题在于tabs方法,ajaxComplete在加载内容后工作正常,但tabs仍不能正常工作
// TAB
    if (btnIndex === -1) {
        // No button focused. Jump to the confirm button.
        $targetElement = $okButton;
    } else {
        // Cycle to the next button
        if (btnIndex === $modalButtons.length - 1) {
            $targetElement = $modalButtons[0];
        } else {
            $targetElement = $modalButtons[btnIndex + 1];
        }
    }

    _stopEventPropagation$fireClick.stopEventPropagation(e);
    $targetElement.focus();

    if (params.confirmButtonColor) {
        _setFocusStyle.setFocusStyle($targetElement, params.confirmButtonColor);
    }