不清楚你在问什么
<button id="ss">商品id</button>
<button onclick="xxx('')">跳转页面按钮</button>//xxx('')改成xxx('跳转到指定网址')则跳转到指定网址
<script>
function xxx(ww){var u=document.getElementById("ss").innerHTML;
if(ww!=""){window.location.assign(ww);
}else{window.location.assign("index.html?"+u);获取按钮上的id跳转到页面,id=1跳转到index.html?1,id=2跳转到index.html?2
}
}
温馨提示:内容为网友见解,仅供参考