lundi 5 octobre 2015

JavaScript - MathRandom Number - Replace "|" with random number

I have a textbox and a button. If I click on the button a random number between 1 and 1500 will appear in the textbox. Under that I put a div box with a "contenteditable" function in HTML. Inside that box, I wrote some text inside it: e.g. The number is [NUMBER]. When I click on the button a random number will appear (1 to 1500). But I like that this random number will be automatically be "pasted" into my editable div box, where the text "The number is ..." is. How can I do that? Only a click on the button, a random number appears and then my text will change to "The number is '982 e.g.'".




Aucun commentaire:

Enregistrer un commentaire