JSFiddle - React, Tailwind, and code Playground
HTML
<p class='item'>
<span>Leo Blokhuis Award - Grootste muziekkenner :</span> <input type="text" name="LeoBlokhuis">
</p>
<p class='item'>
<span>Philippe Geubels Award - User met de meest humor :</span> <input type="text" name="PhilippeGeubels">
</p>
<textarea id="output" id="" cols="30" rows="10"></textarea>
JavaScript
(function($) {
$('input').change(updateOutput);
function updateOutput() {
var output = "";
$("p.item").each(function(item) {
var text = $("span", this).text();
var value = $("input:text", this).val();
if(value && value.length > 0) {
console.log("adding", value)
output += "[b]" + text + "[/b]" + " " + value + "\n\n";
}
})
console.log("Setting output", output)
$('#output').val(output);
}
function getUser(award) {
return $('input[name="' + award + '"]').val();
}
})(jQuery);