有没有JS(不是jQuery的)方法来获得从跨度网址(例如:<span id="h">http://x.com?d=d&x=x</span>)
没有 & 更改为&s???
谢谢你 。
document.getElementById("h").textContent.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
Run Code Online (Sandbox Code Playgroud)
(替换调用用于修剪前导和尾随空格,在您的情况下您可能不需要这样做。)