I am trying to create a list based off of user input. However I keep getting the error :li.parent is not a function. How can is solve this and create a list of user input resutls?
This is what i tried, my html:
<table id="resultTable" cellpadding="1" cellspacing="1" border="1">
<tr>
<th scope="col"></th>
<th scope="col">Hoeveelheid</th>
<th scope="col">Gewicht x KG</th>
</tr>
<tr>
<td>1</td>
<td class="HoeveelheidField"><INPUT TYPE="NUMBER" MIN="0" MAX="10" STEP="1" ></td>
<td class="GewichtField"><INPUT TYPE="NUMBER" MIN="0" MAX="10" STEP="1" ></td>
</tr>
<tr>
<td>2</td>
<td class="HoeveelheidField"><INPUT TYPE="NUMBER" MIN="0" MAX="10" STEP="1" ></td>
<td class="GewichtField"><INPUT TYPE="NUMBER" MIN="0" MAX="10" STEP="1" ></td>
</tr>
<tr>
<td>3</td>
<td class="HoeveelheidField"><INPUT TYPE="NUMBER" MIN="0" MAX="10" STEP="1" ></td>
<td class="GewichtField"><INPUT TYPE="NUMBER" MIN="0" MAX="10" STEP="1" ></td>
</tr>
</table>
</div>
<button onclick ="window.location.href = '#close';getData(); writeData(); " href="#close" id="submitButton" class="tester2"> Submit </button>
<p>
<ol id ="exerciseList">
</ol>
</p>
My JS:
const exerciseName = document.getElementById("exercise-search");
function gotData(data){
//console.log(data.val());
var exercise = data.val();
console.log(exercise);
console.log(exercise.hoeveelheidKilogram);
exercise.repetitie.forEach(function getReps (value) {
console.log(value);
});
exercise.hoeveelheidKilogram.forEach(function(value) {
console.log(value);
});
for (var i = 0; i < HoeveelheidArr.length; i++) {
var li = document.createElement('li',exerciseName.value );
li.parent('exerciseList');
}
}
I did look around a bit and read that it might have to do with library conflictions. However I dont see how, here are the libraries i use:
<script src="https://www.gstatic.com/firebasejs/7.12.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.12.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.12.0/firebase-database.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"
type="text/css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="Workout.js" defer></script>
Should I take a different approach cant see what im doin wrong.