I have a list of names that I want to randomize and have been able to get it to work, bit I also need these names to load in an text input field.
The code below works, but value="p id="demo1"/p" doesnt make it appear in the text input.
Thanks
<input type="text" id="input_7" name="q7_def" data-type="input-textbox" class="form-textbox" size="20" value="" placeholder="" data-component="textbox"/>
<body
onload="document.getElementById('demo1').innerHTML =( getRandomName1() );">
</body>
<p id="demo1"></p>
<script>
function getRandomName1()
{
var names = [
'1111',
'2222',
'33333',
'44444'
];
return names[Math.floor(Math.random() * names.length)];
}
</script>