1

I am building a chatbot widget for my website The problem is the chat with us button shows only the bot not the close button too

this is what I tried

                <input id="chat" type="button" onclick="Show();" value="Chat with us" />
                    <script type="text/javascript">
                            function Show()
                            {document.getElementById("bot").style.display="block";}
                            {document.getElementById("close").style.display="block";}
                            {document.getElementById("chat").style.display="none";}

                    </script>

it should show both the bot and close

1 Answer 1

1

You're closing your function after the first line (only bot will hide). Remove the other braces:

function Show() {
  document.getElementById("bot").style.display = "block";
  document.getElementById("close").style.display = "block";
  document.getElementById("chat").style.display = "none";
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.