This is the code:

button 1 is an `actionbutton` ,the `observeevent` is defined as follows

```
 observeEvent(
    input$button1,{

   mid<-c("1","2")

   name<-c("a","b")

  datatable1<-data.frame(mid,name)

output$deatilscv <- renderUI({

 div(id="div1",

          fluidPage(shinyjs::useShinyjs(),

   actionButton("button2", "CLICK")  )) )}

observeEvent(

    input$button2,{

a<-datatable1(1,1)  #this shows an error datatable1 not found

print(a)
})

```

How to access `datatable1` details inside `observeevent` of `actionbutton button2`