2
是否有一種方法可以將元素的屬性值(特別是id)作爲字符串獲取? 例如以下行導致 「()」:Threepenny-GUI:獲取字符串的屬性值
field <- UI.new
# set (attr "id") "some text"
on UI.drop field $ \_ -> do
-- Some label to print the attribute value to
label <- getElementById window "labelID"
id <- get (attr "id") field
(element (fromJust label)) # set text (show id)
由於attr
返回WriteAttr
,get
可能無法工作。有沒有解決方法?
提前致謝!
問候