Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][PHP]Identyfikacja diva (który znajduje sie w pętli foreach) w JS
BienuSS
post
Post #1





Grupa: Zarejestrowani
Postów: 152
Pomógł: 0
Dołączył: 3.11.2017

Ostrzeżenie: (10%)
X----


Witam.
Potrzebuje funkcji która w JS zastąpi mi getElement by ID, ponieważ nie działa mi ta funkcja gdy jest w kodzie pętli foreach

Kod
<input onkeyup='document.getElementById('win".$i."').innerHTML = this.value;' /><br/><br/>

<div id='win".$i."'>Potential win:</div></br>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
BienuSS
post
Post #2





Grupa: Zarejestrowani
Postów: 152
Pomógł: 0
Dołączył: 3.11.2017

Ostrzeżenie: (10%)
X----


  1. <div id='1".$i['id_match']."' class='betwindow'>
  2.  
  3. <p><b>Your bet: </b></p>
  4.  
  5. <form action='place_bet.php' method='post' class='betBox'>
  6.  
  7. <center><input type='text' id='value_coins' name='value_coins' autocomplete='off'
  8.  
  9.  
  10.  
  11. onkeydown='return ( event.ctrlKey || event.altKey
  12. || (47<event.keyCode && event.keyCode<58 && event.shiftKey==false)
  13. || (95<event.keyCode && event.keyCode<106)
  14. || (event.keyCode==8) || (event.keyCode==9)
  15. || (event.keyCode>34 && event.keyCode<40)
  16. || (event.keyCode==46) )'
  17.  
  18. onkeyup='document.getElementById('win".$i['id_match']."').innerHTML = this.value;' /><br/><br/>
  19.  
  20. <div id='win".$game['id_match']."'>Potential win:</div></br>
  21. <input type='submit' name='submit' id='Submit'></center>
  22.  
  23.  
  24. </form>
  25.  
  26.  
  27.  
  28.  
  29. </div>
  30.  


Ten post edytował BienuSS 28.11.2017, 22:21:55
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 28.12.2025 - 00:39