js html remove code example
Example 1: javascript clear div
//using javascript
document.getElementById(elementID).innerHTML = "";
//using JQuery
$('#elementID').html('');
Example 2: js remove if
ar = [1, 2, 3, 4];
ar = ar.filter(item => !(item > 3));
console.log(ar) // [1, 2, 3]