“botão Javascript Add para div” Respostas de código

botão Javascript Add para div

// get the element you want to add the button to
var myDiv = document.getElementById("demo");

// create the button object and add the text to it
var button = document.createElement("BUTTON");
button.innerHTML = "Button";

// add the button to the div
myDiv.appendChild(button);
Rubahn Die U-Bahn

Adicionar botão para adicionar o item javascript


<script>
    function addItem(){
        var li = document.createElement("LI");  
        var input = document.getElementById("add");
        li.innerHTML = input.value;
        input.value = "";

        document.getElementById("faves").appendChild(li);
    }
</script>

<input type="button" id="btnAdd" value="Add" onclick="addItem()">

Nasty Newt

botão Javascript Add para div

4444




Different Dragonfly

Respostas semelhantes a “botão Javascript Add para div”

Perguntas semelhantes a “botão Javascript Add para div”

Mais respostas relacionadas para “botão Javascript Add para div” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código