IDL(接口描述语言)

Interface description language

 1 // 定义 HTMLInputElement
 2 // 冒号 ":" 表示 HTMLInputElement 继承自 HTMLElement
 3 interface HTMLInputElement: HTMLElement {
 4   // 接下来是 <input> 元素的属性和方法
 5 
 6   // "DOMString" 表示属性的值是字符串
 7   attribute DOMString accept;
 8   attribute DOMString alt;
 9   attribute DOMString autocomplete;
10   attribute DOMString value;
11 
12   // 布尔值属性(true/false)
13   attribute boolean autofocus;
14   ...
15   // 现在方法:"void" 表示方法没有返回值
16   void select();
17   ...
18 }

 

posted @ 2020-12-22 13:55  呈心者  阅读(909)  评论(0编辑  收藏  举报