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

2019年8月12日月曜日

テキストエリアに入力したら反応したい(oninput)


こういうテキストエリアを作りたい

デモ:
テキストエリアに入力したらアラートを出す





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




index.html
<!DOCTYPE html>
<html>
  <body>
    <textarea id="ta"></textarea>
    <script>
      document.getElementById('ta').oninput = myFunction;
    
      function myFunction() {
        alert('input');
      }
    </script>
  </body>
</html>



Latest post

Google Classroom API でクラスの一覧を取得したい

自分が指導・参加しているクラスの名称とIDを取得するコードを試しました 下記 Code.gs では pageSize で 100 を設定していますが 必ず 100件 返ってくるとは限らないらしいです https://developers.google.com/workspace/...