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

  • 关于我们
  • 免责声明