class Gracz{ constructor(nazwa){ this.imie = nazwa; this.liczbaPodejsc = 10; this.czas; this.propozycja; this.oknoKomunikatu; this.komunikat; this.informacja = function(tekst){ this.oknoKomunikatu = document.getElementById("informacja"); this.komunikat = document.createTextNode(tekst); this.oknoKomunikatu.replaceChild(this.komunikat,this.oknoKomunikatu.childNodes[0]); //alert(this.oknoKomunikatu.innerHTML); } this.gramy = function(){ this.start = Date.now(); while(true){ } } } } var gracz1 = new Gracz(prompt("Podaj imiÄ™!")); gracz1.informacja("siema "+gracz1.imie);