如何将此javascript代码转换为jquery

How to convert this javascript code into jquery?

本文关键字:转换 jquery 代码 javascript      更新时间:2023-09-26

我有一个像这样的javascript代码:

function share22() {
    if(!isOneChecked('choice')) {
        alert('Please select the file..');
        return false;
        }
       document.getElementById('share_popup').style.display="block";
       }

我想把这个对话框转换成简单的jquery,这样我就可以编辑标题。

试试这个

   function share22() {
      if(!isOneChecked('choice')) {
       alert('Please select the file..');
       return false;
      }
      $("#share_popup").css("display", "block");
   }

考虑if(!isOneChecked('choice')) {正在检查复选框是否被选中

  function share22() {
     if ($(".choice").is(":not(:checked)")){
       alert('Please select the file..');
       return false;
     }
     $('#share_popup').show();
   }
function share22() {
    if(!isOneChecked('choice')) {
        alert('Please select the file..');
        return false;
        }
       $('#share_popup').css("display","block");
       }