How can one hide / show an input-group in Bootstrap

I’m trying to hide / show a Bootstrap 5 input-group as shown here:

However, once hidden, the input group no longer shows correctly when shown again. How can this functionality be properly implemented?

function dotoggle() {
  elem = document.getElementById("hideme")
  if ( == "none") { = "block";
  } else { = "none";
<link rel="stylesheet" href="">

<script src=""></script>

<div class="input-group mb-3" id="hideme">
  <span class="input-group-text" id="basic-addon1">@</span>
  <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">

<button onclick="dotoggle()">

451 thoughts on “How can one hide / show an input-group in Bootstrap”

  1. I believe what you said was very reasonable. But,
    what about this? suppose you wrote a catchier post title?
    I ain’t saying your content isn’t good, however suppose you added a post title that makes people want more?
    I mean How can one hide / show an input-group in Bootstrap – JavaScript Help is a little boring.
    You could look at Yahoo’s home page and see how they create article headlines to
    get viewers to open the links. You might try adding
    a video or a related pic or two to get people interested about what you’ve written. In my
    opinion, it might make your posts a little livelier.

  2. Hey I know this is off topic but I was wondering if you knew of any widgets I
    could add to my blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something
    like this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  3. Pingback: ivermect 6
  4. It’s a shame you don’t have a donate button! I’d without a doubt donate to this fantastic blog!
    I guess for now i’ll settle for bookmarking and
    adding your RSS feed to my Google account. I look forward to fresh updates and
    will talk about this blog with my Facebook group. Talk soon!

  5. Attractive portion of content. I simply stumbled upon your blog and in accession capital
    to assert that I acquire in fact enjoyed account your blog posts.

    Any way I’ll be subscribing to your augment or
    even I fulfillment you access persistently quickly.

  6. Just want to say your article is as amazing. The clarity to your
    publish is simply great and that i can assume you are a professional on this
    subject. Well together with your permission allow me
    to grasp your feed to stay updated with impending post.

    Thanks one million and please continue the enjoyable work.

  7. Pingback: ivermectay 6 mg
  8. Pingback: buy plaquenil
  9. Yesterday, while I was at work, my sister stole my iphone and tested
    to see if it can survive a forty foot drop,
    just so she can be a youtube sensation. My apple
    ipad is now broken and she has 83 views. I know this is totally off topic but
    I had to share it with someone!

  10. Pingback: sex games ios
  11. [url=]provigil 100mg tablets[/url] [url=]avodart .5 mg[/url] [url=]buy neurontin[/url] [url=]sildalis[/url] [url=]cozaar 50 mg price[/url] [url=]purchase ampicillin online[/url] [url=]tadacip for sale[/url]


Leave a Comment