I just nee a help .. no idea why this post is duplicated ... no one wanna to help
I'm new to iframes and I just want to know how to get specific `<li>` data after clicking on it.
Here is my Code:
**index.html**
<iframe src ="navigation.html" linkTarget = "iframe" scrolling="no" onload="resizeIframe(this)"></iframe>
So i calling this iframe from index ... and want to get `<li>` specific `<p>` element by clicked on one of them data(like menu you know...)
For Example
**navigation.html**
<ul>
<li class="outset" >
report link<br>
<p>10210316_021938.html</p>
</li>
<li class="outset">
report link<br>
<p>20210316_021938.html</p>
</li>
<li class="outset">
report link<br>
<p>30210316_021938.html</p>
</li>
<li class="outset">
report link<br>
<p>40210316_021938.html</p>
</li>
</ul>
So the general idea is get this specific value from iframe it could be:
10210316_021938.html
or
20210316_021938.html
or
30210316_021938.html
etc...
I need this values to use them in another iframe to make something like dynamical preview by clicking on this specific `<li>`
In the end i will Add new iframe that will looks like ::
I don't really need this, what Elite person , sent for me ... :::
window.addEventListener("click",function() {
document.getElementById('myframe')
.contentWindow
.document
.querySelectorAll("li.outset p")
.forEach(p => console.log(p.textContent));
});
I just need to implement 'good click function' on my `<li>` element ...
After click on it i will specify which Value was got of this li ...
After i got this value i will use it like that to new Iframe ::
<iframe src ="../SourceFolderSample/{ValueFromIframe.html}" linkTarget = "iframe" scrolling="no" onload="resizeIframe(this)">
What I have tried:
I don't really need this, what Elite person , sent for me ... :::
window.addEventListener("click",function() {
document.getElementById('myframe')
.contentWindow
.document
.querySelectorAll("li.outset p")
.forEach(p => console.log(p.textContent));
});
this code just getting all values of li -> p in WINDOW CLICK
in my self , i need get Specific value of CLICKED li -> p