Jump to content
HeatoNn

Programare HTML+Javascript

Recommended Posts

Posted

Poti folosi un <input> cu "id" ca sa citesti acel numar:

 

<input type="text" id="nr">

 

<script>var nr = document.getElementById("nr").value;</script>

 

Si ca sa le afisezi poti folosi un div:

 

<div id="afisare"></div>

 

var suma = 0; // Ca sa o calculezi

var afisare = document.getElementById("afisare");

 

for(var i = 0; i < n; i++)

{

    suma += i;

    afisare.innerHTML = afisare.innerHTML + i + "<br>";

}

 

Ceva de genul ca idee, probabil sunt probleme in ce am scris.

Posted
2 hours ago, Nytro said:

Poti folosi un <input> cu "id" ca sa citesti acel numar:

 

<input type="text" id="nr">

 

<script>var nr = document.getElementById("nr").value;</script>

 

Si ca sa le afisezi poti folosi un div:

 

<div id="afisare"></div>

 

var suma = 0; // Ca sa o calculezi

var afisare = document.getElementById("afisare");

 

for(var i = 0; i < n; i++)

{

    suma += i;

    afisare.innerHTML = afisare.innerHTML + i + "<br>";

}

 

Ceva de genul ca idee, probabil sunt probleme in ce am scris.

Mersi mult

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...