从html中的click事件中获取标签的数据值

this is my code snippest.

<div class="pagination pagination-0" style="-moz-user-select: none;">
<a class="jp-previous jp-disabled">«</a>
<a class="jp-current">1</a>
<span class="jp-hidden">...</span>
<a class="">2</a>
<a class="jp-next">»</a></div>

from this code i want fetch value of

<a class="jp-current">

through jquery. please note, id is restricted to use with it.

Try this:

$(".jp-current").on("click", function () {
    console.log($(this).text());
})

http://jsfiddle.net/U6mBQ/

And if you don't need that just on click:

console.log($(".jp-current").text());
var val = $(".jp-current").first().text();

Use

$(".jp-current").click(function () {
    console.log(this.innerHTML); // or this.textContent
})

References

.textContent

.innerHTML

class-selector