如何使用jquery验证或检查标签中的跨度? [英] how to verify or check span in label using jquery?

查看:234
本文介绍了如何使用jquery验证或检查标签中的跨度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1. < label for ="test"> demo * </label>
2.< label for ="test"&d; demo</label>

按钮单击范围是/否no

请帮助我

预先感谢.

1. <label for="test">demo*</label>
2.<label for="test">demo</label>

button click span yes/no chek

please help me

thanks in advance.

推荐答案

我同意您并不特定于您的问题.
如果我对您的理解正确,我在下面回答:

检查
I agree you are not specific to your question.
I am answering below if I understood you correctly :

check for
 if(


(" 标签").find( span").length> 0){ // 您可以找到它的跨度. } 其他 { // 标签下没有间距. }
("label").find("span").length >0 ){ //there is span you find it. } else{ //there is no span under the label. }

如果为0,则标签内不存在跨度;如果大于0,则标签下存在跨度.

希望对您有所帮助.

if it is 0 then there is no span exists inside the label else if it is more than 0 then there is span under the label.

Hope it helped.


这篇关于如何使用jquery验证或检查标签中的跨度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆