I have a text input field, which on DOM ready, I want to have pre-populated with some random text, I dont want to have the same text each time I reload the page, just a slight variation between the text would be fine.
Here is the JQuery Field:
// on dom ready
$("#Title").val("This is the Title");
// end dom ready
I would like the above field to be populated with some random text, MAX: 55 Characters, I was using the following script from Dynamic Drive, This works for web page content, but not for what I want to do with JQuery.
function filltext(words){
var gibberish=["This is just some filler text", "Some Random Text Here", "Even more Random Text"]
for (var i=0; i<words; i++)
document.write(gibberish[Math.floor(Math.random()*3)]+" ")
}
So basically, I want a input field to be pre-populated on DOM Ready, with some random text (That I could specify). BUT cannot exceed 55 Characters.
Surely, just replace
document.writewith$('#Title').val.