MARCELO Posted June 10, 2018 Share Posted June 10, 2018 Hi. How can i create a modal box that opens with a link and not with a buttom? There s this modal box in how to section, but the only idea i have is adding the <a>tag, but what would i do next? would i need to use javascript in this case? here s the modal: https://www.w3schools.com/code/tryit.asp?filename=FS7SL482J55S thanks. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 10, 2018 Share Posted June 10, 2018 Just give the anchor link the same id. Link to comment Share on other sites More sharing options...
MARCELO Posted June 27, 2018 Author Share Posted June 27, 2018 Sorry. For what i understood, i should do this right? <a href="myModal">Open my Modal</a> If so, its not working. What s wrong? Link to comment Share on other sites More sharing options...
dsonesuk Posted June 27, 2018 Share Posted June 27, 2018 (edited) On 6/10/2018 at 11:19 PM, dsonesuk said: Just give the anchor link the same id. IS 'href' the new 'id' now? I know new trends change often, but somehow using 'href' instead of 'id' just isn't going to be practical in my opinion. Edited June 27, 2018 by dsonesuk Link to comment Share on other sites More sharing options...
webtrickshome Posted July 24, 2018 Share Posted July 24, 2018 You are missing the # symbol in ahead of the id name followed by the data-toggle attribute. it should be <a href="#myModal" data-toggle="modal>Your Link Text Here</a>. data-toggle="modal" opens the modal window. data-target or href="#myModal" points to the id of the modal i.e. the id of the parent <div> of the model. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now