Osc*_*son 5 html javascript jquery namespaces xml-namespaces
例如,是否有一种简单的方法来删除XML名称空间,但保持jQuery或JavaScript的标记不变?例如:
<html:a href="#an-example" title="Go to the example">Just an Example</html:a>
Run Code Online (Sandbox Code Playgroud)
并将其更改为:
<a href="#an-example" title="Go to the example">Just an Example</a>
Run Code Online (Sandbox Code Playgroud)
使用jQuery或JavaScript实时运行,并且不知道其中的元素和/或属性?
<script>
如果代码中没有要替换的标签可以尝试(demo):
container.innerHTML = container.innerHTML
.replace(/<(\/?)([^:>\s]*:)?([^>]+)>/g, "<$1$3>")
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3468 次 |
最近记录: |