❔ How do I hide or show a div based on the value of a property of my selected option?
When I select a habit type, that habit type has a Measurability property, and I want to show or hide divs based on the value of this property. How can I do it?
By the way, the reason for which I don't want to do it with the name/value of the selected option, is because I would have to hardcode these options in a JavaScript function, but the user is able to add new habit types.
8 Replies
You want to do that dynamically? Without page refresh?
Or on page load?
Sorry but could you explain me which would be the difference? I want the divs to remain hidden until the user selects an option
Well... the difference is page reload or no page reload
If there was a page reload wouldn't the selected option data be lost?
Depends how you handle it
Well, with no page reload then
Use JS
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.