I'm trying to make a web page with some data from another url.
I want to get the 5 cheapest item prices to my page. Is it possible to use getElementsByClassname
to get the prices? I know that the class of the prices is item-amount
.
I'm trying to make a web page with some data from another url.
I want to get the 5 cheapest item prices to my page. Is it possible to use getElementsByClassname
to get the prices? I know that the class of the prices is item-amount
.
I am assuming that you are using GET request to obtain the data.
If so, then the data must be in JSON format. From there on it is easy. You can't use getElementsByClassName because it doesn't understand that language.
Let's assume you have the JSON data as.
In this case, you can use the data simply by accessing the price property.