Javascript/node.textContent

解説 ノードとその子孫のテキスト内容を取得、または設定
sample1
s1Div01
sample1code
// テキスト内容の取得
var s1Div01 = document.getElementById("s1Div01").textContent;
console.log(s1Div01);
// テキストの内容を設定
document.getElementById("s1Div02").textContent = "s1Div02";
	
sample2
s2Div
sample2code
//文字列を一文字ずつspanで囲む
var textbox = document.querySelector('#s2Div');
var text = textbox.textContent;
textbox.innerHTML = null;
text.split('').forEach(function (c) {
  textbox.innerHTML += 'span>' + c + '/span>';
});