I have an iframe with multiple div tags. I have no control over the div class names.
For that I have 2 DIVs with the same class name I want to select the second DIV with the content inside this DIV. I couldn’t manage until now anything, I just can retrieve the whole iframe using the code below.
var myIFrame = document.getElementById("iframe");
var content = myIFrame.contentWindow.document.body.innerHTML;
alert(content);
$("#comment").val(content);
How do I retrieve the content of the second DIV?
This will give you the content of the 2nd div with
.className