gpt4 book ai didi

javascript - 如何在 jQuery 中检查输入类型图像值

转载 作者:行者123 更新时间:2023-12-03 09:30:13 25 4
gpt4 key购买 nike

我想检查 input type = image 的值而不是 input type = checkbox

这是模板

<div class="wrap_col td5"><input type="image" src="/pc/images/kick.png" alt="Submit" id="buttonKick" value="{$participant.channel}"></div>

这就是函数

$('#buttonKick').click(function(e) {
e.preventDefault(); // cancel default behavior
var data = [];
var conference = $("select[name='subuid'] option:selected").val();
var action = "confbridgekick";
getAllCheckAtParticipants(conference,data, action ,function(results){
socket.emit("action",results);
});

这就是 Action

var getAllCheckAtParticipants = function(conference, data, action, callback) {
var $chk = $("#room_"+conference).find("input[type='checkbox']:checked").not(".chkAllParticipants");
$chk.each(function(index){
if (action=="confbridgekick") {
var channel = $(this).val();
data.push({ 'action': action, 'conference': conference, 'channel': channel });
}
});

我如何更改它以检查输入类型=图像的值

    var $chk = $("#room_"+conference).find("input[type='checkbox']:checked").not(".chkAllParticipants");

最佳答案

$("input[type='image']").val();

关于javascript - 如何在 jQuery 中检查输入类型图像值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31535412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com