Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用jquery警报确认框“;是”&&引用;否";_Jquery_Html - Fatal编程技术网

如何使用jquery警报确认框“;是”&&引用;否";

如何使用jquery警报确认框“;是”&&引用;否";,jquery,html,Jquery,Html,有人知道如何使jQuery与我的HTML和CSS一起工作。当我点击按钮并打开中间的警告框时,我需要一些文本和选项“是”、“否”,当我点击“是”删除文本时? 我的代码在这里: <div class="text">Some text here <a href="#" class="deleteMe"> <span class="delete-icon"> x Delete </span> </a> <

有人知道如何使jQuery与我的HTML和CSS一起工作。当我点击按钮并打开中间的警告框时,我需要一些文本和选项“是”、“否”,当我点击“是”删除文本时? 我的代码在这里:

<div class="text">Some text here 
    <a href="#" class="deleteMe">
        <span class="delete-icon"> x Delete </span>
    </a>
</div>
这里有一些文本

我不会编写您的代码,但您需要的是类似jquery对话框的东西

看看这里

$(function() {
    $( "#dialog-confirm" ).dialog({
      resizable: false,
      height:140,
      modal: true,
      buttons: {
        "Delete all items": function() {
          $( this ).dialog( "close" );
        },
        Cancel: function() {
          $( this ).dialog( "close" );
        }
      }
    });
  });

<div id="dialog-confirm" title="Empty the recycle bin?">
  <p>
    <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>
    These items will be permanently deleted and cannot be recovered. Are you sure?
  </p>
</div>
$(函数(){
$(“#对话框确认”)。对话框({
可调整大小:false,
身高:140,
莫代尔:是的,
按钮:{
“删除所有项目”:函数(){
$(此).dialog(“关闭”);
},
取消:函数(){
$(此).dialog(“关闭”);
}
}
});
});

这些项目将被永久删除,无法恢复。你确定吗?


请参阅以下代码片段:

$(文档)。在(“单击”,“a.deleteText”,函数()上){
如果(确认('你确定吗?')){
$(this.prev('span.text').remove();
}
});

一些文本

此插件可以帮助您

它易于设置,并具有一系列强大的功能

$.confirm({
    title: 'Confirm!',
    content: 'Simple confirm!',
    buttons: {
        confirm: function () {
            $.alert('Confirmed!');
        },
        cancel: function () {
            $.alert('Canceled!');
        },
        somethingElse: {
            text: 'Something else',
            btnClass: 'btn-blue',
            keys: ['enter', 'shift'], // trigger when enter or shift is pressed
            action: function(){
                $.alert('Something else?');
            }
        }
    }
});
除此之外,您还可以从远程url加载内容

$.confirm({
    content: 'url:hugedata.html' // location of your hugedata.html.
});

1.您没有添加代码2。你的问题毫无意义我是新来的。。fiddle里面也没有js代码???我问的是如何做,因为我不知道jQuery必须如何使用itI,我问的是有人知道如何做,我不是问你的意见我需要做什么。如果你不确定你的答案,请不要写。我认为这样可以。谢谢你,我会看看你是怎么写的。谢谢这个
confirm
实际上是js而不是jq:P