Witam
Mam problem z wyświetlaniem w okienku wybranej wartości.
Możecie podpowiedzieć jak to zrobić?
Mam taki kod html:
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> <link rel="stylesheet" href="my.css" /> <script src="scripts/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<!-- Home -->
<div id='calculator' data-role="page" > <div data-theme="a" data-role="header"> Kalkulator
<div data-role="content"> <div data-role="fieldcontain"> <input type="text" style="text-align: right;" value="0" id="display" name="display"/>
<a data-role="button" data-inline="true" href="#" class='digits'>1
</a> <a data-role="button" data-inline="true" href="#" class='digits'>2
</a> <a data-role="button" data-inline="true" href="#" class='digits'>3
</a> <a data-role="button" data-inline="true" href="#" class='digits'>4
</a> <a data-role="button" data-inline="true" href="#" class='digits'>5
</a> <a data-role="button" data-inline="true" href="#" class='digits'>6
</a> <a data-role="button" data-inline="true" href="#" class='digits'>7
</a> <a data-role="button" data-inline="true" href="#" class='digits'>8
</a> <a data-role="button" data-inline="true" href="#" class='digits'>9
</a> <a data-role="button" data-inline="true" href="#" class='digits'>0
</a>
<a data-role="button" data-inline="true" href="#" class='operations'>+
</a> <a data-role="button" data-inline="true" href="#" class='operations'>-
</a> <a data-role="button" data-inline="true" href="#" class='operations'>*
</a> <a data-role="button" data-inline="true" href="#" class='operations'>/
</a> <a data-role="button" data-inline="true" href="#" class='operations'>=
</a>
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