I have been trying to create a textnode that will expand and contract onclick, however it refuses to work in google chrome and displays [object Text] in firefox, where am I going wrong?
http://jsfiddle.net/jonSnow70/uf1bbk5q/
window.onload = function ()
document.getElementById("myBtn").addEventListener("click",
textchange);
function textchange() {
var status = "less";
var text = document.createTextNode('Mmm ... something');
if (status == "less") {
document.getElementById("textArea").innerHTML = text;
status = "more";
} else if (status == "more") {
document.getElementById("textArea").innerHTML = "";
status = "less"
}
}