What's the best way to replace links with JS functions?

后端 未结 8 1716
死守一世寂寞
死守一世寂寞 2021-01-31 05:49

A pattern that\'s started to show up a lot in one of the web apps I\'m working are links that used to just be a regular a-tag link now need a popup box asking \"are you sure?\"

相关标签:
8条回答
  • 2021-01-31 06:43
    <a href="http://..." onclick="return confirm('are you sure?')">text</a>
    
    0 讨论(0)
  • 2021-01-31 06:55

    Take a look at What’s the best way to open new browser window. You can do something similar, but throw up the confirmation prior to opening a new window.

    0 讨论(0)
提交回复
热议问题