[Solved] Store First & Second Character value in two different veritable [closed]


Using plain javascript, you can use the “substring” method of a string object to retrieve specific characters. Please see MDN String::substring

var main = document.getElementById("ccMain");
var text = main.innerText;
console.log("First Letter: " + text.substring(0,1));
console.log("Second Letter: " + text.substring(1,2));
<div id="ccMain">Simple Text</div>

solved Store First & Second Character value in two different veritable [closed]