Google closure get value from DOM element

197 Views Asked by At

I'm using Google closure on top of ClojureScript, what is the way to get a value from a "select" in a html element?

I'm trying :

(.value (gdom/getElement "select-combo"))

but I'm getting:

Uncaught TypeError: goog.dom.getElement(...).value is not a function

I also tried "getValue" but no luck so far. I can't find the function in Google API docs either.

Using jQuery it should be:

   $("#select-combo").val(); 
1

There are 1 best solutions below

0
Alan Thompson On

Checkout the ClojureScript CheatSheet

You can get a value natively

(.-innerHTML el)

Or using cljs-oops library:

(oget el "innerHTML")