DOM notes
Lauren McCarthy edited this page
·
3 revisions
Pages 36
- Home
- Archived Content
- Beyond the canvas
- Code of Conduct
- Contributed Tools, Projects, Demos
- Design Principles
- Development
- Development Checklist
- Development – extended
- DOM notes
- Education
- Embedding p5.js
- Frequently Asked Questions
- Friendly Debugger
- Getting Started
- Getting started with WebGL in p5
- Inline documentation
- Instantiation Cases
- Integrating other libraries
- Intro to DOM manipulation and events
- Intro to HTML and CSS
- Issue Labels
- JavaScript basics
- Libraries
- Loading external files: AJAX, XML, JSON
- Local server
- p5.js Contributors Conference at CMU
- p5.js overview
- p5.js, node.js, socket.io
- Positioning your canvas
- Preparing a pull request
- Processing transition
- Reference
- Release steps
- SimpleHTTPServer
- Supported browsers
- Show 21 more pages…
Clone this wiki locally
Current DOM API documentation
(more or less)
- https://github.com/lmccart/itp-creative-js/wiki/Week-3#html-manipulation-with-p5js
- tutorial
- ITP creative-js examples
- p5.js workshop (see examples 9)
Current DOM issues open
- Fullscreen API and presentation mode
- specifying DIV ID with global mode, remove support of canvas ID/node specification?
- multi-argument createHTML methods
- other create methods (see below for more notes)
- bonzo?
Other HTML elements to address
(From @shiffman) I'm working on several examples for ITP's "Creative JavaScript" class where I'm having to break into the Document object directly.
Links?
var link = createLink("blah blah");
// <a href="#">blah blah</a>
// an event for when the link is clicked
button.mousePressed(clicky);
var clicky = function() {};
Buttons?
var button = createButton("blah blah");
// <button type="button">blah blah</button>
// an event for when the button is clicked
button.mousePressed(clicky);
var clicky = function() {};
Input elements?
var input = createInput(TEXT,"age");
// <input type="text" name="age"></input>
input.text("Enter your age here");
// An event for when the user types into the text field?
input.keyPressed(typing);
var typing = function() {};
var s = input.getInput(); // what the user has entered
or
var input = createTextInput("age");
var range = createInput(RANGE,"size",10,100);
//<input type="range" name="size" min="10" max="100">
range.moved(itmoved); // an event for when the user changes the slider?
var itmoved = function() {};
var val = range.getValue(); // the current value of the slider
or
var range = createRange("size",10,100);