当复选框的文本在javascript中匹配时,选中复选框 [英] Check the checkbox when text of checkbox is matching in javascript
本文介绍了当复选框的文本在javascript中匹配时,选中复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个javascript或jquery语法,可以检查带有匹配文本的复选框。例如 - 如果我将Film作为来自不同页面的参数的文本然后从MultiSelect DropDownList中删除,则应该检查匹配Film文本的那个。动态。
我尝试过:
Hi,
i need a javascript or jquery syntax that can check a checkbox with matching text. For example - if i have "Film" as text coming as parameter from different page then out of MultiSelect DropDownList, the one which matches "Film" text should get checked. dynamically.
What I have tried:
I have already tried this "jQuery('.editbutton').click(function($) {
jQuery(this).closest('tr').find('[type=checkbox]').prop('checked', true);
});"
jQuery('"+Name+"').closest('input').find('[type=checkbox]').prop('checked', true);
here
here
Name
=将从不同的页面接收值(作为查询字符串)
= value will be received from different page (as a query string)
推荐答案
){
jQuery (this).closest('tr')。find('[type = checkbox]')。prop('checked',true);
});
jQuery('"+Name+"').closest('input').find('[type=checkbox]').prop('checked', true);
here
here
Name
=将从不同页面(作为查询字符串)
= value will be received from different page (as a query string)
这篇关于当复选框的文本在javascript中匹配时,选中复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文