createElement

(別名: create_element)

def setup
  background(220)
  h5 = createElement('h5', 'I am an h5 P5Element!')
  h5.style('color', '#00a1d3')
  h5.position(10, 0)
end

p5.jsリファレンス(参考情報)

[p5.js] createElement

概要

指定されたタグの HTML要素を生成します。

書式

elm = createElement(tag [, content])

引数

引数名内容備考オプションデフォルト値
tagHTML要素のタグ
contentHTMLコンテンツHTML要素に挿入""

戻値

elm : p5elementオブジェクト

備考

関連