Yes, it will work just fine, but you need to remove the wood/item you are glueing and let it dry. I don't know how long, but i would wait an hour or two. Just mist the plants and keep them wet. They do sell something for corals that you can apply in the tank and is safe for fish, might be good to know if you can't remove the piece from the tank. If it is up high enough you can drain the tank below that point and glue.
You can probably use crazy glue but since you are attaching plants the bond may not last that long. When I use it for corals I'm attaching the skeleton to rock so the bond is more durable. The coral tissue then grows over the glue and bonds the coral to the rock. I use zip ties or fishing line for anubias and just remove them once the plant has grown onto the wood.
Cyanoacrylate glues like Crazy Glue skin over once they hit water so they don't leach toxic stuff into the water column. Definitely use the gel type glue if you want to try anyway.