Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try this using simple javascript, in this example you did not need to include any js file:</p> <p>Here in the below example I have created one simple javascript function getValue() who is going to do desired task for you, Also I have implemented this with number 7 only. You have to code this function according to your needs...</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; .vKeyboardSplKeys { background-color:#DEDBE4 ; border:1px solid #666666; display:inline-block; color:#000000; font-family:arial; font-weight:bold; padding:3px 6px; margin : 2px; cursor:pointer; } .vKeyboardSplKeysHover { background-color:#8cb82b; } .vKeyboardSplKeys:active { position:relative; top:1px; } .vKeyboardKeys { width:9px; background-color:#EEEEEE; border:1px solid #666666; display:inline-block; color:#000000; font-family:arial; font-weight:bold; padding:3px 8px; margin : 2px; cursor:pointer; } .vKeyboardKeysHover { background-color:#CEE9FC; } .vKeyboardKeys:active { position:relative; top:1px; } .space { padding : 3px 40px; } #vKeyboard{ border : 1px solid #DDDDDDD; background-color : #F4F4F4; padding:5px; text-align:center; } &lt;/style&gt; &lt;script&gt; function getValue(val) { document.getElementById('answer').value = val; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;center&gt; &lt;input type="text" id="answer" value=""&gt; &lt;div id="vKeyboard" style="width: 100px;"&gt; &lt;span class="vKeyboardSplKeys vKeyboardSplKeysHover" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; Backspace &lt;/span&gt; &lt;br&gt; &lt;span onclick="getValue(7);" class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 7 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 8 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 9 &lt;/span&gt; &lt;br&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 4 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 5 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 6 &lt;/span&gt; &lt;br&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 1 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 2 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 3 &lt;/span&gt; &lt;br&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; 0 &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; . &lt;/span&gt; &lt;span class="vKeyboardKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; - &lt;/span&gt; &lt;br&gt; &lt;span class="vKeyboardSplKeys" data="left" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; &amp;larr; &lt;/span&gt; &lt;span class="vKeyboardSplKeys" data="right" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; &amp;rarr; &lt;/span&gt; &lt;br&gt; &lt;span class="vKeyboardSplKeys" style="border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;"&gt; Clear All &lt;/span&gt; &lt;br&gt; &lt;/div&gt; &lt;/center&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload