Difference between revisions of "P5js-Dom-Textarea"

From Digipool-Wiki
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
 +
== Befehl ==
 +
 
<pre>
 
<pre>
  
Line 6: Line 9:
  
 
</pre>
 
</pre>
 +
 +
<br>
 +
 +
== Example ==
 +
 +
<pre>
 +
var myString;
 +
var myInput;
 +
 +
function setup() {
 +
  myInput = createElement('textarea', 'your text here');
 +
  myInput.position(100, 100);
 +
  myInput.size(200,200);
 +
  myInput.style("resize", "none");
 +
}
 +
 +
function draw() {
 +
  background(220);
 +
 
 +
  myString = myInput.value();
 +
  text(myString, 20, 20);
 +
}
 +
</pre>
 +
 +
 +
Siehe auch [https://www.w3schools.com/jsref/dom_obj_style.asp w3schools HTML DOM Style Object]
 +
 +
<br>

Latest revision as of 16:00, 21 June 2021

Befehl


myInput = createElement('textarea', 'your text here');

myString = myInput.value();


Example

var myString;
var myInput;

function setup() {
  myInput = createElement('textarea', 'your text here');
  myInput.position(100, 100);
  myInput.size(200,200);
  myInput.style("resize", "none");
}

function draw() {
  background(220);
  
  myString = myInput.value();
  text(myString, 20, 20);
}


Siehe auch w3schools HTML DOM Style Object