以下のことを実現したいと思いますので、よろしくお願いいたします。
ボタンのクリック:
- 同じウィンドウでリンク先URLを開く
.show()
そのURLから特定
宛先 URL を制御できる場合は、表示する div の ID をクエリとして渡し、その ID onLoad を取得して表示できます。
self.location = "nextPage.html?div=foo";
//nextPage.html
document.onload = function(){
if(self.location.search.indexOf("div=") == 0){
document.getElementById(
self.location.search.substring(4)).style.visibility = "visible";
}
}
//nextPage.html body...
<div id="foo" style="visibility:hidden">
宛先 URL を制御できない場合は、何もできません。
スタックへようこそ!:) 回答が有用であることがわかった場合は、必ず賛成票を投じて正しいとマークしてください。
div を表示したいだけの場合は、 a href="" onClick="document.getElementById('div').visibility='visible' を試すことができます