kotlinx.html icon indicating copy to clipboard operation
kotlinx.html copied to clipboard

Provides a short access to document elements by ID via delegated

Open jonnyzzz opened this issue 6 years ago • 1 comments
trafficstars

property syntax. Received element is not cached and received directly from the [Document] by calling [Document.getElementById] function on every property access. Throws an exception if element is not found or has different type To access an element with theId ID use the following property declaration

val theID by document.gettingElementById

To access an element of specific type, just add it to the property declaration

val theID : HTMLImageElement by document.gettingElementById

see for more details: https://youtrack.jetbrains.com/issue/KT-32552

jonnyzzz avatar Aug 15 '19 15:08 jonnyzzz

Also reported in https://github.com/JetBrains/kotlin/pull/2458

jonnyzzz avatar Aug 15 '19 15:08 jonnyzzz