var szam1Div = document.getElementById("szam1"); var duplaGomb = document.getElementById("duplaGomb"); var eredmenyDiv = document.getElementById("eredmeny"); var rejtGomb = document.getElementById("rejtGomb"); rejtGomb.onclick = function() { eredmenyDiv.style.display = "none"; }; duplaGomb.onclick = function() { eredmenyDiv.style.display = "block"; var szam1Str = szam1Div; if(szam1Str.match("[^0-9]")) { alert("Nem vĂ¡rt karakter!"); }else { var eredmeny = 2 * szam1Div.Value; eredmenyDiv.innerHTML = eredmeny; } };