计算锚标签的点击次数
问题描述:
我有一个 <a href="" ></a>
在我网站上的一个页面上.我想计算用户点击此链接的次数并显示它.这怎么办?
I have a <a href="" > </a>
on a page on my webiste. I wanted to count the number of clicks on this link by the user and display it. How can this be done?
答
为文档中的每个标签表示一个计数器并使用 jquery.data 存储数据的最佳方式,在每次点击时增加计数器,
best way to represent a counter for each a tag on your document and store the data with jquery.data, increasing the counter on each click,