The following is my anchor tag........
<display:setProperty name="paging.banner.full" value='<p><span id="hix-pagination"><span> <a id="id1" class="prev" href="{1}">◄◄</a>
And I tried the following using jquery but did not get any positive result.....
alert($('#id1').text());
alert($('#id1').html());
alert($('#id1').val());
You have right selector, if you have jQuery included successfully then you may need document.ready also check if you get html out of DOM
$(function(){
alert($('#id1').html());
});
Refer this link :
How to get anchor text/href on click using jQuery?
href:
$(function(){
$('div.res a').click(function(){
alert($(this).attr('href'));
});
});
Text:
$(function(){
$('div.res a').click(function(){
alert($(this).text());
});
});
$(document).ready(function()
{
$("#id1").click(function() {
alert($(this).text());
return false;
});
}
);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.