Apps Script公式リファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2018年8月20日月曜日

要素の中身を編集可能にしたい contenteditable=true


このように書くとdiv要素の中身を編集可能にできる

<div contenteditable=true>edit here</div>


デモ
edit here



コード.gs
function doGet() {
  return HtmlService.createHtmlOutputFromFile("index");
}
意訳
この機能がやること
指定したHTMLファイルを表示する




index.html
<!DOCTYPE html>
<html>
<body>
  <div contenteditable=true>edit here</div>
</body>
</html>

意訳
 


編集可能なdiv要素





補足


JSで指定したいときはsetAttributeでこのように↓

ELEMENT.setAttribute("contenteditable", true);



参考

HTMLElement.contentEditable
https://developer.mozilla.org/ja/docs/Web/API/HTMLElement/contentEditable

Latest post

Google Apps Scriptの障害時はIssueTrackerを見てみる - Incidents for Apps Script are reported on Issue Tracker

IssueTracker > Apps Script issues https://issuetracker.google.com/savedsearches/566234 Google Apps Scriptの障害時は IssueTracker に課題が上がっていることが...