jQuery change div content

前端 未结 2 1860
死守一世寂寞
死守一世寂寞 2021-01-16 19:16

I need help changing my code so that it changes div content on click to link id example: I click first link, it prints out 1 and so one. And also it will have an unique link

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-16 20:02

    Try this out:

    $('#1').click(function(){ $('.tabs').html('Your Text'); })

    you can include this in a function which accepts the id and sets the value at the appropriate location in the dom tree

    Since your a tag should not perform the default action, you should prevent a from the same.

提交回复
热议问题