This question is an exact duplicate:
The site has a timer
<div class="timer">1100</div> player's nickname
<div class="myanme">MyNick</div> I catch a timer
function find_timer() { var div_timer = document.getElementsByTagName('div'); for (var i = 0; i< div_timer.length; i++) if(div_timer[i].className == "tttimer") return timer_element = div_timer[i]; } Nick
function find_myname() { var div_name = document.getElementsByTagName('div'); for (var i=0; i< div_name.length; i++) if(div_name[i].className == "myanme") return name_element = div_name[i]; } How to make the right condition for if?
var value = parseInt(timer_element.innerHTML); var myname = "Nick"; var value2 = toString.name_element; // может и не правильно тяну ник.... if(((value2 = myname) && (value=15))) {} want:
if ((the variable monik coincided with the nickname is now on the site) and (timer value = 15)), then {..}
in fact, the other nicknames also launch part of {.}