mardi 18 octobre 2016

How to increase counter(score) when img is dragged to a div in html5 with javascript?

My code compiling but not counting up/down

HTML

<div id="poäng">
        <div id="räknare">
        <input type="text" size="15" name="score" id="score" value="0">
        </div>

JavaScript

function poäng(){
    if(part1.innerHTML == '<img src="bilder/public.png">'){
    p = parseInt.document.getElementById("score").value;
        p += 1;
    }else{
        p -= 1;
        }
    }

The image is dragged from from a div to another part3 to part1. Part3 contains img from start

Aucun commentaire:

Enregistrer un commentaire