How do I return the output of JS function to my HTML input element.
Form like this .
Now on my click Run - Script i execute simple script
<button type="submit" class="btn btn-success form-control" onclick="$('#output').toggle();" onclick="Task_1(document.getElementById('word').value,document.getElementById('repeat').value)">Run script</button>
function Task_1(word, repeat_number) {
console.log("------------------------------------");
var Output = "";
for (var i = 0; i < repeat_number; i++) {
Output = Output + word;
}
console.log(Output);
return Output;
}
An the output of that script should be show on additional input box
I tried with
document.getElementById("output").innerHTML = Output.toString();
Complete : JS FIDDLE - Task#1
Also: If i rotate two commented lines
<link rel="stylesheet" ...
<script src="h ...
it gives me the great output as i wanted but then the modal window doesn't work. The only difference is in version 4.1.2 and 3.3.7 how to bypass it.
Note: Learner who is going through tutorials. Point me at start so i wont go in wrong direction.


var result = word.repeat(repeat_number):)