简体   繁体   English

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

[英]how to check input type image value in jQuery

I want to check the value of input type = image instead of input type = checkbox 我想检查输入类型=图像的值,而不是输入类型=复选框

This is the template 这是模板

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

This is the function 这是功能

$('#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);
    });

this is the 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 });
        }
    });

How can i change this to check the value of input type = image 我如何更改此值以检查输入类型=图像的值

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM