Add script.js which work with header.html :p

This commit is contained in:
Némunaire 2012-06-18 21:00:20 +02:00
parent f2a4098897
commit b0eeaa1be2
1 changed files with 23 additions and 0 deletions

23
script.js Normal file
View File

@ -0,0 +1,23 @@
function add()
{
var element = document.createElement("input");
element.setAttribute("type", "text");
element.setAttribute("id", "answer");
element.setAttribute("name", "answer" + nbAnswer);
nbAnswer++;
element.setAttribute("placeholder", "Nouvelle réponse");
var foo = document.getElementById("answerList");
foo.appendChild(element);
}
function hideShow(which)
{
if (!document.getElementById)
return
if (which.style.display == "block")
which.style.display = "none"
else
which.style.display = "block"
}