How to avoid page refreshing on anchor () tag click?

前端 未结 3 745
面向向阳花
面向向阳花 2021-01-14 04:17

I\'m creating a dynamic website. My problem is when i click on the following tag:



        
3条回答
  •  -上瘾入骨i
    2021-01-14 04:56

    you need to prevent default action on the click event.

    You can do a simple inline handler which will return false

    Interesante
    

    or write a jQuery handler which will do the same

    $('.s-inte').click(function(e){
        e.preventDefault()
    })
    

提交回复
热议问题