samedi 27 février 2016

Randomly italicize words in a bunch of texts on javascript button click

I know it's a weird thing to do but I'd like to create a javascript button that, when clicked on, italicizes randomly a bunch of texts. "Italicize randomly" means that only certain words, say 1 out of 20, should be in italics, but each time different ones (regardless of their function or nature -- verb, noun, subjet, preposition etc).

I was thinking of calling an array and then get "str.italics()", but that would mean that I'll have to methodically copy into the code all texts' lexique, right ? I'm sure there's a prettier way to do that.

Thanks.




Aucun commentaire:

Enregistrer un commentaire