I want to populate 2 arrays that I have which are called 'regions' and 'asbos'. I want to do this using a list of the following data of ASBOs record in each Criminal Justice System area:
Avon and Somerset 559,
Bedfordshire 220,
Cambridgeshire 285,
Cheshire 387,
Cleveland 489,
Cumbria 275,
Derbyshire 319,
Devon and Cornwall 473,
Dorset 197,
Essex 361,
I also wanted to create a loop for each region, giving it a particular font size that depends on the number of ASBOs and then store that formatted text in the 'tempText variable' as follows:
tempText += "<span style='font-size:" + asbos[i]/14 + "px';>" + regions[i] + "</span> ";
This is what I have so far in my HTML file:
<!DOCTYPE html>
<html>
<head>
<title>Javascript_Arrays</title>
</head>
<body>
<div id="wordCloud"></div>
<script>
//asbo word Cloud Generator
var regions = [];
var asbos = [];
var tempText = "";
// add loop here to create text for printing
document.getElementById("wordCloud").innerHTML = tempText;
</script>
</body>
</html>