我需要在我的 html 表中禁用 a
链接标签(其 href
属性值以 log.html
开头)。我正在尝试使用字符串替换来做。
代码行大致如下所示,str.replace(/log.html...../g,'')
其中必须有一个正则表达式模式来代替点。
所有的模式都是这样,
<a class="log" href="log.html#s1-s1-s1"></a>
<a class="log" href="log.html#s1-s2-s100"></a>
<a class="log" href="log.html#s10-s5-s1"></a>
必须做成,
<a class="log" href="#"></a>
最佳答案
关于javascript - 用于替换和禁用 href 链接的正则表达式模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30339680/