From 231998f4df79fa32ad7248d78ca2187bd6724d66 Mon Sep 17 00:00:00 2001 From: Gregg B Date: Tue, 24 Jul 2018 11:19:15 -0400 Subject: [PATCH] Add html element example --- JSDoc-support-in-JavaScript.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JSDoc-support-in-JavaScript.md b/JSDoc-support-in-JavaScript.md index dd029c2..93cd1d9 100644 --- a/JSDoc-support-in-JavaScript.md +++ b/JSDoc-support-in-JavaScript.md @@ -63,6 +63,14 @@ var var8; /** @type {{a: string, b: number}} */ var var9; +// You can specify as an HTML Element + +// An element with dom properties +/** @type {HTMLElement} myElement */ +var myElement = document.querySelector(selector); +element.dataset.myData = ''; + + // "@typedef" may be used to define complex types // (this same same syntax works with @param) /**