多个文本框值的Jquery问题。 [英] Jquery Problem for multiple text box value.
本文介绍了多个文本框值的Jquery问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在验证同一课程的多个文本框时遇到问题。
你能告诉我一个解决方案。我的HTML代码如下。
< input type =textplaceholder =Country Codeclass =phone/>< input type =textplaceholder =phone numberclass =phone/> ;
我只想验证。
Hi,
I am getting problem while validating multiple text box of same class.
can you please tell me a solution.my html code is as follows.
<input type="text" placeholder="Country Code" class="phone" /><input type="text" placeholder="phone number" class="phone" />
I just want to validate.
推荐答案
在文本框中使用id并选择文本框由他们各自的id而不是上课。
use id in your text boxes and select text box by their respective id instead of class.
<input id="t1" type="text" placeholder="Country Code" class="phone" />
<input id="t2" type="text" placeholder="phone number" class="phone" />
( document )。ready( function ( ){
(document).ready(function(){
(' #t1')... ....; // 选择器为id
('#t1').......; //selector as id
这篇关于多个文本框值的Jquery问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文