Home > Blockchain >  Create a marquee with multiple random word from list
Create a marquee with multiple random word from list

Time:01-11

im new to programing javascript I need help to make a infinite marquee scrolling texts with contain list of first name,last name and prize

maybe using math.random? but i cant implement that array to marquee

thx before

like this

Carolanne ***** Won - $1261 | Jamar ***** Won - $4879 | Camila ***** Won - $2047 | and so on

list of first name

  • carolanne
  • jamar
  • camila

list of last name random amount of "*"

list of prize betwen $500 up to $10.000

CodePudding user response:

If you want to get a random number in a range you can use the following function:

function randomNumber(min, max) {
  return Math.round(Math.random() * (max - min))   min;
}

Then you can call it like this:

randomNumber(500, 10000);

CodePudding user response:

I think you are looking for random generate number

console.log(Math.floor(Math.random() * 9500)   500);

CodePudding user response:

i want select multiple words/number from multiple array and put them on marquee/scrolling texts

var firstname = Array("carolanne"."jamar"."camila");
var laststname = Array("***"."****"."*****");
randomNumber(500, 10000);

and output like this

<marquee>Carolanne ***** Won - $1261 | Jamar ***** Won - $4879 | Camila ***** Won - $2047 |Carolanne ***** Won - $1261 | Jamar ***** Won - $4879 | Camila ***** Won - $2047 |Carolanne ***** Won - $1261 | Jamar ***** Won - $4879 | Camila ***** Won - $2047 |</marquee>
  • Related