payal_suthar payal_suthar - 5 months ago 8
Javascript Question

Is there any way to hide a button but retain its functionality

I have a button on navigation bar which when clicked, displays a dialog box.I want to keep this button invisible and whenever anyone clicks at the place where the button is placed it should open a dialog box i.e. it should remain fully functional even if it is invisible.I have tried

visibility:hidden
and
display:none
but nothing seems to provide me the desired result.Here is the fiddle -
https://jsfiddle.net/payalsuthar/58bw712t/5/
I want to hide the button in this fiddle and if i click at the place where the button is placed it should display the dialog box.
Thanks in advance.

Answer

In that case, you can use opacity: 0

Comments