var QAPairs = [];
var QATotal = 112; // total numbers of QA pairs
var QA = QATotal; //number of QA pairs you want. Set to QATotal to include all QA pairs
while (QAPairs.length != QA) {
var rand = Math.floor(Math.random() * QATotal);
if (QAPairs.indexOf(rand) == -1) {
QAPairs.push(rand);
// If you want to show them all at a time
for (i = 0; i < QAPairs.length; i++){document.getElementsByClassName("card click")[i].innerHTML = document.getElementsByClassName("card click")[i].innerHTML + '<div class="front">\
<img src="http://www.new.chemistry-teaching-resources.com/Resources/CfENewHigher/FlashCards/Intermolecular/Q' + QAPairs[i] + '.png" width="100%" height="100%" alt="" />\
</div>\
<div class="back">\
<img src="http://www.new.chemistry-teaching-resources.com/Resources/CfENewHigher/FlashCards/Intermolecular/A' + QAPairs[i] + '.png" width="100%" height="100%" alt="" />\
</div>';}
}
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.