logo
  • 教程列表
  • SO官方文檔
  • Scala.js
    • Scala.js 中的 console.log
    • 胖箭頭函式
    • 簡單的類
    • 集合
    • 操作 DOM
    • 與 SBT 一起使用
  1. StackOverflow 文件
  2. Scala Language 教程
  3. Scala.js
  4. 操作 DOM

操作 DOM

Created: November-22, 2018

import org.scalajs.dom
import dom.document

def appendP(target: dom.Node, text: String) = {
  val pNode = document.createElement("p")
  val textNode = document.createTextNode(text)
  pNode.appendChild(textNode)
  target.appendChild(pNode)
}
  • 與 SBT 一起使用
  • 集合

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明