In the process of converting my code from Jquery to Vanilla JS I have this code snippet that I can't convert:
function updateTextBox(nehemyah) {
var delfino = $("#campotxt").val().split("\n");
delfino.remove(nehemyah);
$("#campotxt").val(delfino.join("\n"));
}
I tried this:
let camPito = document.getElementById("campotxt");
function updateTextBox(nehemyah) {
let delfino = camPito.value;
delfino = delfino.split("\n");
delfino = delfino.remove(nehemyah);
delfino = delfino.join("\n");
}
The idea is that this textarea
is cleared line per line once I press a button. If I use that Jquery snippet it works without problem.