It is a part from design. When I click it will be shown URL with the /#signup. I need to test further.
When you click button, it will be executed HTML but bottom code will not be executed. Strange that Javascript error is not shown inside console.
Your suggested code is working with without any issue.
Inside application it will not work as it will constantly show /#signup. As I understand it is allowed inside bootstrap. As it is a part of testing code I can not show the whole HTML or CodePen.io.
As your code is working it seems some other issue as /#signup should not be shown inside URL.
I have removed hide in Bootstrap3. It works collapse and div element is showing display: none and display: block for the container. Do you have any clue why is showing /#signup. Is it a conflict inside other CSS or other Javascript?
It seems to me the same issue as a script to the top where you put element called HREF and #. If scroll to the top does not work it will be shown inside URL like /#toTheTopButton
It is strange for me as local script works but server side will show up /#signup
You are excellent developer. I do not get it. My button works now. Is this jQuery and Javascript event issue or Bootstrap issue as link will not work but button is detected?
Not sure what you are asking exactly but it should all be working.
You should use a link when you want to go somewhere (a destination) but when you want an action to happen (such as showing or hiding something) then a button should be used.
Read this:
Of course it can be tricky of you are opening a modal which is basically another section then you can make a case for a link or a button.
If you don’t want a url to appear in the address bar then you probably need a button. The js takes care of the rest as it doesn’t care if the element is a link or a button or anything else.