Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS API to access DOM elements by ID via delegated properties #2458

Closed
wants to merge 3 commits into from

Conversation

jonnyzzz
Copy link
Member

See KT-32552 for more details.

Provides a short access to document elements by ID via delegated
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

@ilya-g ilya-g requested a review from bashor July 12, 2019 19:16
@jonnyzzz
Copy link
Member Author

I've moved the PR to the kotlinx.html repository. Please fill free to close it

@ilya-g ilya-g closed this Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants