Adding close button in div to close the box

后端 未结 7 1874
一整个雨季
一整个雨季 2020-12-23 20:13

I have created a URL preview box for the entered URL.

Preview is shown in the div box. I want to add a close option on the right top. How could be done so that when u

相关标签:
7条回答
  • 2020-12-23 21:07

    A jQuery solution: Add this button inside any element you want to be able to close:

    <button type='button' class='close' onclick='$(this).parent().remove();'>×</button>
    

    or to 'just' hide it:

    <button type='button' class='close' onclick='$(this).parent().hide();'>×</button>
    
    0 讨论(0)
提交回复
热议问题