How to add id in jquery?

前端 未结 5 570
無奈伤痛
無奈伤痛 2021-01-06 13:31

I have created one dialog box in jquery. and there is one button called \'save\'. I need to add one id to this save buttton. How can I achive in this in jquery. This is my c

5条回答
  •  星月不相逢
    2021-01-06 13:48

    $(function() {
        $( "#dialog" ).dialog({
          height: 400,
          width: 650,
          modal: true,
          buttons: {
            save: {
              text: "Save",
              id: "my-button-id",
              click: function(){
                dialog.dialog( "close" );
              }   
            }
          }
          ...
        });
    });
    

提交回复
热议问题