我想检查 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/