如何在检查元素名称时添加jquery或condition [英] How to add jquery or condition while checking name of element
本文介绍了如何在检查元素名称时添加jquery或condition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
如何添加一个测试条件来检查元素名称
我想添加OR条件来检查名称'TestName2'更多
Hi
How do i add one more test condition to check name of an element
I want to add OR Condition to check name 'TestName2' and more
$("#body").on("change", "input[name='TestName1']", function (e) {
// Something
});
谢谢
我尝试了什么:
i尝试了但没有得到确切的语法
Thanks
What I have tried:
i tried but not getting exact syntax
推荐答案
(#body)。on(change,input [name ='TestName1'],function(e){
// Something
});
("#body").on("change", "input[name='TestName1']", function (e) { // Something });
谢谢
我尝试了什么:
i尝试了但没有得到确切的语法
Thanks
What I have tried:
i tried but not getting exact syntax
试试
try
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
(document).ready(function(){
(document).ready(function () {
这篇关于如何在检查元素名称时添加jquery或condition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文