I want to put a word's alphabets into vertical direction.
Example: <div>SOLD TO</div>
Output: S O L D T O
Please reply how to achieve it.
You will need to use JavaScript.
<div id="dvInput"> SOLD TO</div> <div id="dvOutput"> </div> <script type="text/javascript"> window.onload = function () { var input = document.getElementById("dvInput").innerHTML; var arr = input.replace(' ', '').split(''); var output = ""; for (var i = 0; i < arr.length; i++) { arr[i] = arr[i].replace(' ', ''); if (arr[i] != '') { output += arr[i] + "<br />"; } } document.getElementById("dvOutput").innerHTML = output; }; </script>
Demo
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.