【问题标题】:remove complete href link tag from html从 html 中删除完整的 href 链接标签
【发布时间】:2014-09-17 19:37:55
【问题描述】:

如何获得

预期输入:

<a href="#" id="r1A" role="button" tabindex="-1">
        <input type="button" id="r1B" value="Back" role="option" aria-pressed="false" class="keyboard-enabled" tabindex="6">
</a>
    <input type="submit" id="continue" value="CRA" name="continue" class="keyboard-enabled" tabindex="7">

转换成

<input type="button" id="r1B" value="Back" role="option" aria-pressed="false" class="keyboard-enabled" tabindex="6">

使用 JQUERY 替换或删除。 请提出建议。

【问题讨论】:

标签: javascript jquery


【解决方案1】:

您可以使用$.fn.unwrap

$('#r1B').unwrap();

【讨论】:

    【解决方案2】:

    怎么样;

    $('#r1B').parent().replaceWith($('#r1B'));
    

    DEMO

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-20
      • 2022-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-19
      相关资源
      最近更新 更多