Use any HTML element to open the modal. This is often a button or a link. Add the onclick attribute and point to the id of the modal (id01 in our example), using the document. getElementById () method and specify a unique ID that matches the "trigger" button (id01). Instead of:
with class="modal-content" I'm using the link to open a size guide popup in product pages. If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: W3Schools is optimized for learning and training. Is there a fix for this? By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Get certifiedby completinga course today! Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. in case a scrollbar appears). Just replace it: Register