diff options
author | alexichi <alexbankai96@gmail.com> | 2016-05-07 17:54:54 +0200 |
---|---|---|
committer | alexichi <alexbankai96@gmail.com> | 2016-05-07 17:54:54 +0200 |
commit | 3795b462a30a1942f5ebac3105e72824acbd1a87 (patch) | |
tree | a21ad4adee4749e4eff6f75b2f19fd6d0d10fcd3 /js | |
parent | f5f13ebb900746c942d339149a838b6c8ef0586d (diff) | |
download | candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.tar.gz candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.tar.bz2 candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.tar.xz candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.zip |
add id to item in order to change the value client side
Diffstat (limited to 'js')
-rw-r--r-- | js/shop.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -35,7 +35,7 @@ function addItem(ret) { var itemtag = document.querySelector("[data-name=\""+ret[0].name+"\"]"); if(!itemtag){ //si c'est la première itération de l'objet itemhtml += "<li>"; - itemhtml += "<button type=\"button\" class=\"btn btn-success\" onclick=\"useItem('" + ret[0].name + "')\"><span class=\"item-icon\">" + ret[0].icon + "</span><br />" + ret[0].name + "(<span data-name=\""+ ret[0].name + "\">"+ret[1]+"</span>)</button>"; + itemhtml += "<button type=\"button\" class=\"btn btn-success\" onclick=\"useItem('" + ret[0].name + "')\"><span class=\"item-icon\">" + ret[0].icon + "</span><br />" + ret[0].name + "(<span id=\"nbItem\" data-name=\""+ ret[0].name + "\">"+ret[1]+"</span>)</button>"; itemhtml += "</li>"; } else{ // si c'est une n-ième itération |