scalajs radio button
-
javascript callback 처리 하기 - radio buttonweb/mhtml 2022. 1. 3. 23:55
코드 import mhtml._ import org.scalajs.dom import scala.xml.Elem val optionVar: Var[String] = Var("naver") def optionItem(name: String): Elem = if (x == name) Some("checked") else None)} onclick={ () => optionVar := name }> {name} val content = {optionItem("naver")} {optionItem("google")} selected: {optionVar} mount(dom.document.getElementById("main_content"), content)