javascript - innerHTML showes blank in chrome -
i want take user input text of textarea [textbox] , put on p [cparagraph] working on ie not on chrome
function toggleoverlay(){ var overlay = document.queryselector("#overlay"), modal = document.queryselector("#modal"); if(overlay.style.display !== "block" || modal.style.display !== "block"){ overlay.style.display = "block"; modal.style.display = "block"; }else { overlay.style.display = "none"; modal.style.display = "none"; } } function submitmsg() { var cheader = document.queryselector(".cheader"), cparagraph = document.queryselector(".cparagraph"), username = document.queryselector("#username"), textbox = document.queryselector("#textbox"); cparagraph.innerhtml = textbox.innerhtml; cheader.innerhtml = username.value; toggleoverlay(); } document.queryselector("#post").addeventlistener("click", toggleoverlay,false); document.queryselector("#submit").addeventlistener("click", submitmsg, false);
Comments
Post a Comment