刪除第一部分url我在我的網頁中有url,我想從href中刪除前面部分(http://example.com/?),只保留第一個子div並從主div刪除其餘的div。我必須使用js或jQuery來做這件事我該怎麼做?從標籤
<div class="main">
<a href="http://www.example.com/?https://someotherurl.org" target="_blank">google</a>
<div class="div-1">
data
</div>
<div>
extra
</div>
<div>
extra
</div>
</div>
<!-- the final code I want is -->
<div class="main">
<a href="https://someotherurl.org" target="_blank">google</a>
<div class="div-1">
data
</div>
</div>
是你的'http://www.example.com/?'固定長度嗎? – Luca
你到目前爲止嘗試過什麼? – styfle
你的javascript看起來像什麼? – hRdCoder