Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> JQuery - wyświetlanie w polu tekstowym wybranej wartości
leewang
post
Post #1





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 19.11.2009
Skąd: Chrzanów / Kraków

Ostrzeżenie: (0%)
-----


Witam

Mam problem z wyświetlaniem w okienku wybranej wartości.

Możecie podpowiedzieć jak to zrobić?

Mam taki kod html:

  1. <!DOCTYPE html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <meta name="viewport" content="width=device-width, initial-scale=1" />
  5. </title>
  6. <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
  7. <link rel="stylesheet" href="my.css" />
  8. <script src="scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
  9. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  10. <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
  11.  
  12. </head>
  13. <body>
  14. <!-- Home -->
  15.  
  16. <div id='calculator' data-role="page" >
  17. <div data-theme="a" data-role="header">
  18. <h3>
  19. Kalkulator
  20. </h3>
  21. </div>
  22. <div data-role="content">
  23. <div data-role="fieldcontain">
  24. <input type="text" style="text-align: right;" value="0" id="display" name="display"/>
  25. </div>
  26.  
  27.  
  28. <a data-role="button" data-inline="true" href="#" class='digits'>1</a>
  29. <a data-role="button" data-inline="true" href="#" class='digits'>2</a>
  30. <a data-role="button" data-inline="true" href="#" class='digits'>3</a>
  31. <a data-role="button" data-inline="true" href="#" class='digits'>4</a>
  32. <a data-role="button" data-inline="true" href="#" class='digits'>5</a>
  33. <a data-role="button" data-inline="true" href="#" class='digits'>6</a>
  34. <a data-role="button" data-inline="true" href="#" class='digits'>7</a>
  35. <a data-role="button" data-inline="true" href="#" class='digits'>8</a>
  36. <a data-role="button" data-inline="true" href="#" class='digits'>9</a>
  37. <a data-role="button" data-inline="true" href="#" class='digits'>0</a>
  38.  
  39. <a data-role="button" data-inline="true" href="#" class='operations'>+</a>
  40. <a data-role="button" data-inline="true" href="#" class='operations'>-</a>
  41. <a data-role="button" data-inline="true" href="#" class='operations'>*</a>
  42. <a data-role="button" data-inline="true" href="#" class='operations'>/</a>
  43. <a data-role="button" data-inline="true" href="#" class='operations'>=</a>
  44.  
  45.  
  46. </div>
  47. </div>
  48. </script>
  49. </body>


Chciałbym wyświetlić w polu o nazwie display wartość którą przycisnę buttonem.

Jak mogę to zrealizować? Później będę dopisywał sobie funkcje które liczą itd, ale na razie nie wiem jak pokazać to co przycisnę w polu display?

Pozdrawiam

Ten post edytował leewang 21.11.2012, 21:04:21
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: 23.08.2025 - 18:48