カテゴリー別アーカイブ: javascript

GoogleAppScript SlackでBotつくってメッセージ送信

SlackとGoogle App Script(以降、GAS)を連携するサンプルです。
手順はSlackでBotを作成。
GASでスクリプトを作成。
続きを読む


Bookmark this on Yahoo Bookmark
Bookmark this on Google Bookmarks
Share on LinkedIn
LINEで送る
Pocket

[javascript]Cookie削除方法

以下のスクリプトを実行する。
document.cookie = ‘Cookie変数名=;expires=Thu, 01 Jan 1970 00:00:00 GMT’;


Bookmark this on Yahoo Bookmark
Bookmark this on Google Bookmarks
Share on LinkedIn
LINEで送る
Pocket

[javascript]要素の属性の取得方法

以下のようにボタンに「data-test」という要素の属性があり、クリックイベント時にjs側で属性を取得するサンプルです。

html側

<input type="button" onClick="registButton(this)" data-test="aaaaa">

javascript側

function registButton(obj) {
var val = obj.getAttribute("data-test");
alert(val);
}

Bookmark this on Yahoo Bookmark
Bookmark this on Google Bookmarks
Share on LinkedIn
LINEで送る
Pocket