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

Question: innerHTML #41

Closed
vanodevium opened this issue Jul 15, 2024 · 4 comments
Closed

Question: innerHTML #41

vanodevium opened this issue Jul 15, 2024 · 4 comments

Comments

@vanodevium
Copy link
Collaborator

Is there a directive or option to specify the inner html of an element if, for example, that "content" is stored in a global variable?

@dy
Copy link
Owner

dy commented Jul 15, 2024

Can you give an example?

@vanodevium
Copy link
Collaborator Author

@dy

I have an element div#modal.
On page initiation it has innerHTML:

div#modal-header
div#modal-content
div#modal-footer

But after some user actions I have to change this content.

So, if i correctly understand, I have to change some variable and then div#modal will change it's innerHTML reactively

@dy
Copy link
Owner

dy commented Jul 15, 2024

usually I either put :if condition or :hidden flag. If you need whole html content to be taken from somewhere else either use :ref=el :fx=el.innerHTML=str, or :html=otherElement

@vanodevium
Copy link
Collaborator Author

Ok. Thanx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants