This is pretty simple…
function reverse(tag) {
var el = document.getElementById(tag);
if(!el) {
return alert('nope');
}
el.innerHTML = el.innerHTML.split('').reverse().join('');
}
1
solved how to reverse a string that is identified as an id in javascript?