<span class='url_link'>1</span>
<span class='url_link'>2</span>
<span class='url_link'>3</span>
<span class='url_link'>4</span>
<span class='url_link'>5</span>
$(".url_link").each(function(idx, obj){
console.log(this); // <span class="url_link">
console.log(this.text()); // TypeError: this.text is not a function
});
How can I grep the text in span tag?
Use
console.log($(this).text());You were trying to use a jQuery function on a non-jQuery object.
jsFiddle example