开发者

How can I make a simple on-screen HTML keyboard that contains only two buttons and one textbox?

开发者 https://www.devze.com 2023-02-22 04:06 出处:网络
Example On screen keyboard But i want to design keyboard using only two buttons that will contain value 0 and 1

Example

On screen keyboard

But i want to design keyboard using only two buttons that will contain value 0 and 1 like this and v开发者_开发知识库alue should come in textbox

How can I make a simple on-screen HTML keyboard that contains only two buttons and one textbox?

Can anyone tell me how can i do this ?


sample html:

<input type="text" id="theTextField">
<div id="button0">0</div>
<div id="button1">1</div>

sample jquery:

var $yourTextField = $('#theTextField');

$('#button0').click(
    function(){
        $yourTextField.val($yourTextField.val()+"0")
    }
)

$('#button1').click(
    function(){
        $yourTextField.val($yourTextField.val()+"1")
    }
)
0

精彩评论

暂无评论...
验证码 换一张
取 消