diff --git a/LINQ.ts/DOM/DOMQuery.ts b/LINQ.ts/DOM/DOMQuery.ts index 0b5d303..c3e03e9 100644 --- a/LINQ.ts/DOM/DOMQuery.ts +++ b/LINQ.ts/DOM/DOMQuery.ts @@ -14,6 +14,7 @@ namespace DOM { * + ``#`` by id * + ``.`` by class * + ``!`` by name + * + ``$`` by name(alias) * + ``&`` SINGLE NODE * + ``@`` read meta tag * + ``<>`` create new tag @@ -117,6 +118,7 @@ namespace DOM { case "#": return this.getById(expr.substr(1)); case ".": return this.getByClass(expr.substr(1), isSingle); case "!": return this.getByName(expr.substr(1), isSingle); + case "$": return this.getByName(expr.substr(1), isSingle); case "<": return this.createElement(expr); case "@": return this.queryMeta(expr.substr(1)); diff --git a/LINQ.ts/DOM/DOMQueryTypes.ts b/LINQ.ts/DOM/DOMQueryTypes.ts index 646e52f..99a4aa8 100644 --- a/LINQ.ts/DOM/DOMQueryTypes.ts +++ b/LINQ.ts/DOM/DOMQueryTypes.ts @@ -19,6 +19,12 @@ * ```` */ class = 10, + /** + * 表达式为 $xxx + * 按照节点的name属性值进行查询 + * + * ```` + */ name = 100, /** * 表达式为 xxx