aarkerio
aarkerio

Reputation: 2354

Google closure get value from DOM element

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(); 

Upvotes: 0

Views: 204

Answers (1)

Alan Thompson
Alan Thompson

Reputation: 29958

Checkout the ClojureScript CheatSheet

You can get a value natively

(.-innerHTML el)

Or using cljs-oops library:

(oget el "innerHTML")

Upvotes: 1

Related Questions