0
如何從按鈕獲取標題?如何從html元素中檢索文本?
decorateOn : String -> Html Msg -> Html Msg
decorateOn selectedCaption button =
if button.text == selectedCaption then
button [ class "selectedNavigationButton" ] []
else
button [ class "navigationButton" ] []
button
沒有一個名爲text
場。 - 類型的button
是:Html Home.Msg
不包含名爲
text
場。
注意,我意識到「按鈕」實際上是Html類型的消息。