javascript - Random font size and set a min and max of the character -
i have few problems here.
a)how add random font size code?
b)how set limitation of min(3) , max(8) characters?
javascript
function randomstring(length) { var text = ""; var possible = "abcdefghijklmnopqrstuvwxyz"; (var = 0; < length; i++) text += possible.charat(math.floor(math.random() * possible.length)); return text; } function changingrandomstring(length) { setinterval(function () { document.getelementbyid("random").innerhtml = randomstring(length); }, 2000); }
for adding random fond size
document.getelementbyid("myp").style.fontsize = math.floor((math.random() * 8) + 3)+"px"; you have implement own code randomize it
how set limitation of min(3) , max(8) characters?
function randomstring(length) { if(length < 3) length = 3; if(length > 8) length = 8;
Comments
Post a Comment