$.ajax({ url: 'https://api.example.com/data', type: 'GET', dataType: 'json', success: function (data) { }, error: function (xhr, status, error) { } }); $('#myElement').remove(); $('#myButton').click(function () { });