【发布时间】:2017-08-13 20:46:49
【问题描述】:
我对 JS 和 Swift 开发人员非常陌生。我有一个具有此属性的按钮:
<a href="http://phonefiveme.com/nocontact" id="yui_3_17_2_1_1490136681073_127" style="cursor: url("chrome-extension://ledmjlnkdlappilhaaihfhanlpdjjalm/rockhand.png"), auto;">
我需要做的是将该 href 编辑为存储在变量中的链接。这是我所拥有的:
var currentLocation = window.location;
var stringURL = String(currentLocation);
var shortened = stringURL.substring(32);
var myElement = document.getElementById("yui_3_17_2_1_1490136681073_127");
我只需要将“http://phonefiveme.com/nocontact”替换为shortened
任何帮助将不胜感激!非常感谢。 干杯, 西奥
【问题讨论】:
标签: javascript jquery href getelementbyid