Quote:
Originally Posted by devnull69
Example
HTML
Code:
<textarea id="mytext"></textarea>
<div id="container">
</div>
<button id="tweetit" onclick="tweetit();">Tweet</button>
Javascript
Code:
function tweetit() {
var newDIV = document.createElement('div');
newDIV.className = "whatEverYouNeedForStyling";
newDIV.innerHTML = document.getElementById('mytext').value; // put textarea value into new DIV
document.getElementById('container').appendChild(newDIV); // append new DIV to container
}
|
can u explain the javascript part plz , what is 'div' , in
Code:
document.createElement('div');
is this fixed tagname of <div> or just a name