I'm doing a quiz with only jquery and I need to get data from the JSON API through ajax, the data from the JSON API is randomly selected how do I get access properties of the objects?
I did it in this way but is there any other way I can do it instead of writing every single question down.
I'm new to Jquery:) please help
$("p:eq(0)").text(data.results[0].question);
$("p:eq(1)").text(data.results[1].question);
$("p:eq(2)").text(data.results[2].question);
$("p:eq(3)").text(data.results[3].question);
$("p:eq(4)").text(data.results[4].question);
$("p:eq(5)").text(data.results[5].question);