What is the best way to make a button that the modal will click on?

  • 0
    As for me, the button would be stupid in this case using the tag & lt; button & gt; or & lt; a & gt; . It won't be easier to do everything in one div and give cursor: pointer for this div; , and the modal is already c js by pressing?
    And how, in my case, is it wiser to do it?
    JavaScript Anonymous, Jun 22, 2019

  • 2 Answers
  • 0
    I don’t know what kind of picture you have there (it doesn’t load), but judging by the description, it’s dull just to make the div clickable.
    Mason Page

  • 0
    Reasonably like this:

    the button tag, on this button the event handler, in which you show the modal window.

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!