mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
11 lines
353 B
JavaScript
11 lines
353 B
JavaScript
//get text of specified element
|
|
function getText(elementId) {
|
|
var element = (typeof elementId == 'string' ? document.getElementById(elementId) : elementId);
|
|
return element.textContent;
|
|
}
|
|
|
|
function setText(elementId, text) {
|
|
var element = (typeof elementId == 'string' ? document.getElementById(elementId) : elementId);
|
|
element.textContent = text;
|
|
}
|