Change text of a div after clicking the button

0

I am completing the design of a mini shopping cart.

My question is, how to make clicking a button change the title and price of two divs. And another, how to change the payment button according to the product and the values selected by the user?

Prototype link: link

    
asked by anonymous 24.10.2016 / 02:58

1 answer

3
<html>
<body>

<p id="paragrafo">Clique no botão para mudar o texto</p>

<button onclick="funcao()">Clique aqui</button>

<script>
function funcao() {
    document.getElementById("paragrafo").innerHTML = "Pronto você mudou o texto (y)";
}
</script>

</body>
</html>

I hope this is (Y).

    
24.10.2016 / 04:13