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

时间:2015-07-21 09:36:30

标签: javascript jquery

我想检查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);
    });

这是行动

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 });
        }
    });

如何更改此项以检查input type = image

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

1 个答案:

答案 0 :(得分:1)

$("input[type='image']").val();
相关问题