David
David

Reputation: 733

How to retrieve tag's content using jQuery?

I'm trying to capture the value 179 in a variable

<span class="robux " data-se="item-privatesale-price">179</span>

How can I do this using JQuery in the console?

Upvotes: 0

Views: 65

Answers (3)

Todd Mark
Todd Mark

Reputation: 1885

You should learn how to search API of jquery. Here is a link about a method of text();

Upvotes: 0

Dave
Dave

Reputation: 10924

Use the class selector of jQuery

$(".robux").text()

Upvotes: 3

Sean Kwon
Sean Kwon

Reputation: 907

var text = $('.robux').text()

That should work

Upvotes: 1

Related Questions