Slide 11
Slide 11 text
テキストの編集: 単純な方法
┃単純な方法
編集後のテキストを文字列操作で生成
生成したテキストを textArea.value に代入
11
function insert(start, insertText) {
var originalText = textArea.value;
textArea.value = originalText.substring(0, start)
+ insertText
+ originalText.substring(start);
}
function delete(start, end) {
var originalText = textArea.value;
textArea.value = originalText.substring(0, start)
+ insertText
+ originalText.substring(0, end);
}
手作業で
編集後の文字列を
計算してあげる
手作業で
編集後の文字列を
計算してあげる