Home > database >  Why bootstrap 5. 0 Modal doesn't work nor appear
Why bootstrap 5. 0 Modal doesn't work nor appear

Time:02-26

Can you help me fix the modal, I'm using a anchor tag for my bootstrap modal but it doesn't work. What seems to be the problem? '''

<div >Doesn't have an account yet? <a href="#" data-toggle="modal" data-target="#exampleModalCenter">Create an account</a></div>

<div  id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
     <div >
         <div >
             ...
         </div>
     </div>
</div>

'''

CodePudding user response:

Just change to data-bs-toggle, data-bs-target

<div >Doesn't have an account yet? <a href="#" data-bs-toggle="modal" data-bs-target="#exampleModalCenter">Create an account</a></div>
<div  id="exampleModalCenter" tabindex="-1" aria-labelledby="myLargeModalLabel" aria-hidden="true">
   <div >
      <div >
         ..
      </div>
   </div>
</div>
  • Related