开发者

How to write a text in two textbox control at a time

开发者 https://www.devze.com 2023-01-17 22:49 出处:网络
I am working with jquery, i want to write a text in two textbox control ata time开发者_开发技巧.HTML

I am working with jquery, i want to write a text in two textbox control at a time开发者_开发技巧.


HTML

<input type="text" id="textbox1" />
<input type="text" id="textbox2" />

jQuery

$('#textbox1, #textbox2').val('some text');


HTML

<input type="text" id="textbox1" class="sameclass" />
<input type="text" id="textbox2" class="sameclass" />

JS

$('input.sameclass').val('some text')


You can use id^=

$('[id^=textbox]').val('some text');
0

精彩评论

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