185404/jquery-show-won-t-turn-bootstrap-d-none-class-visible
I'm 99% sure I'm missing something terribly obvious here. On the next example, clicking the button should make the div with the .progress class visible. however, it is not working.
function func() { $('.progress').show(); }
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> <div class="progress d-none"> No longer hidden! </div> <button onclick="func()"> click me </button>
When you not sure how your element hidden, with Bootstrap's d-none, or with regular display: none, but you need to make it visible in any case, just use following code:
$(el).removeClass("d-none").show();
I'm trying to display a text message ...READ MORE
document.getElementById("elementId").style.display="none" is used in JavaScript to hide an ...READ MORE
I changed my code to below code ...READ MORE
I want to setup a click event ...READ MORE
When I call bootstrap modal from jquery ...READ MORE
Try this Change the order of files it ...READ MORE
CDNs deliver faster loading speeds for readers. Files ...READ MORE
I am trying to show a part ...READ MORE
pretty simple: $('.check-hide-show-content').hide(); // hide all content divs // ...READ MORE
Main difference between FadeIn, FadeOut vs hide, ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.