跳转本页面锚点链接

lpengxiaop lpengxiaop 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

<script>
function text(){
var text=document.getElementById("text").value;
document.getElementById("text1").innerHTML=text;
}
</script>
<input type="text" id="text" value=""/>
<input type="button" onclick="javascript:window.location.href='#'+text" value="提交"/>
<div id="text1"></div>


...........................................................................
想提交后是锚点的形式 index.html#abcd.....

这却的不出来结果..求解啊
...全文
评论 1
收藏 已收藏
分享
返回顶部
lpengxiaop
JavaScript 87,984 成员 224,681 内容