+ 7
var op = parseInt(Joey.innerHTML, 10); "innerHTML" returns text (a string), so the 5 you added was converted to text, too. Converting op to a number like I did will work :)
30th Sep 2017, 4:48 PM
Schindlabua
Schindlabua - avatar
+ 4
Joey.innerHTML=parseInt(op)+5;
30th Sep 2017, 5:01 PM
Daniel
Daniel - avatar
+ 1
<body> <div id="Chandler"> 8</div> </body> <script> var Joey = document.getElementById ("Chandler"); var op=Joey.innerHTML; Joey.innerHTML=parseInt(op)+5; </script>
30th Sep 2017, 5:14 PM
Rishita
Rishita - avatar
+ 1
Joey.innerHTML=+op+5;
30th Sep 2017, 7:38 PM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar