javascript - 如何从图像中删除标题

标签 javascript jquery css asp.net .net

在 asp.net 中单击提交按钮时,我使用了以下代码来显示正在处理的图像,但在我编写此代码后,标题标签已自动添加,导致在页面顶部显示图像,现在我想删除这个标签或解决这个问题,每次我删除它都会自动恢复。 代码

script type="text/javascript">
function check()
{
$("#checking").show();
}
</script>
OnClientClick="check();" 
<div id="checking" style="display:none;position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: #f4f4f4;z-index: 99;">
  <div class="text" style="position: absolute;top: 45%;left: 0;height: 100%;width: 100%;font-size: 18px;text-align: center;">
    <center>
      <img src="load.gif" alt="Loading">
    </center>
    Checking Please Wait! 
    <Br>Meanwhile Please 
      <b style="color: red;">BE ONLINE
      </b>
      </div>
  </div>

以下代码已自动添加

 <caption>
          <img alt="Loading" src="load.gif"></img>
 </caption>

最佳答案

您可以使用 unwrap()从 DOM 中删除匹配元素集的父元素,将匹配元素留在原处。

$('img').unwrap('caption');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<center>
<caption>
          <img alt="Loading" src="load.gif" />
 </caption>
 </center>
Checking Please Wait! <Br>Meanwhile Please <b style="color: red;">BE ONLINE</b>

关于javascript - 如何从图像中删除标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50813585/

相关文章:

javascript - 多个内联 JS 脚本会减慢页面的加载时间吗?

javascript - JQuery Mobile 不刷新按钮样式

jquery - 如何在使用 clip-path 属性的父元素上保留绝对子元素?

javascript - 将所有元素值放在一个数组中

javascript - 解析 'pip install' 命令以获取已安装软件包文本中的范围

javascript - 跳转到网页部分时暂时突出显示 html 元素

javascript - 如何在jquery模板中使用If else条件来计算span?

html - Bootstrap 网格系统无法正常工作

基于媒体查询的 CSS 过渡

jquery - Fancybox问题,点击打开只是img