Modify DOM node of a Drop Down

What I’m trying to do:
Does anyone know how to modify the DOM node style of a Drop Down object? I am trying to control the border color of a Drop Down selector, but it is not working?

Also, I can not figure out how to update a Drop Down border-color through a role?

What I’ve tried and what’s not working:

Code Sample:

node = anvil.js.get_dom_node(self.drop_down_state)
node.style.borderColor = "red"

Clone link:
share a copy of your app

I’m on my phone, so apologies that I can’t give you a code example but…

Most anvil components have an enclosing div element and that’s the node returned by get_dom_node.

You want to change the properties of a node inside that div.

It’s similar to:

Owen, thanks for the tip. Here is what works.

node = anvil.js.get_dom_node(self.drop_down_state)
node_select = node.querySelector('select')
node_select .style.borderColor = "red"
1 Like