怎样点击是的按钮后运行下面的新增用户

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图

unction btn_add() {

    layer.open({
        type: 0,//type类型
        title: '文本',//弹窗标题
        content: '是否新增',//弹窗内容
        btn: ['是', '否'],
    })
    return

    $.layerOpen({
        id: "add",
        title: "新增用户",
        width: "670px",
        height: "530px",
        content: "/System/User/Form",
        yes: function (iBody) {
            iBody.find('#btnSubmit').click();
            initGrid();
            console.log(132);
        }
    });
}
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

怎么样在点击是的按钮后能运行新增用户的代码

判断他是否被点击呗。 点击之后运行的function方法里面放新增方法就行了

$("#add").onclick(function (){
 $.layerOpen({
        id: "add",
        title: "新增用户",
        width: "670px",
        height: "530px",
        content: "/System/User/Form",
        yes: function (iBody) {
            iBody.find('#btnSubmit').click();
            initGrid();
            console.log(132);
        }
    })