Commit fe2867c0 authored by MohammadAli Keshavarz's avatar MohammadAli Keshavarz

get value from html in js code

parent fd968a97
...@@ -14,5 +14,7 @@ roundScore = 0; ...@@ -14,5 +14,7 @@ roundScore = 0;
activePlayer = 0; activePlayer = 0;
dice = Math.floor(Math.random() * 6) + 1; dice = Math.floor(Math.random() * 6) + 1;
document.querySelector('#current-' + activePlayer ).textContent = dice; document.querySelector("#current-" + activePlayer).textContent = dice;
// document.querySelector("#current-" + activePlayer).innerHTML = "<h1>" + dice + "</h1>"; // document.querySelector("#current-" + activePlayer).innerHTML = "<h1>" + dice + "</h1>";
var x = document.querySelector("#score-1").textContent;
console.log(x);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment