/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function vert (elem) { var el = document.getElementsByTagName(elem); for (var i=0; i < el.length; i++) { var ex = el[i].childNodes[0]; if (el[i].nodeType === 1) { el[i].innerHTML = el[i].innerHTML.split('').join('<br/>'); }; }; } vert('th');