How to differentiate two iframes present on the same jsp
I have two iframes added in a jsp page, with same n开发者_运维问答ame, display name and so on. I am having two different urls which has to be set as target urls in each of these iframes.How can I differentiate these two iframes and set the target urls?
You can use the id attribute which is standard for most html elements (iframe included)
You could give them a different id
so that you can grab them by JavaScript. But, actually, the name
of the <iframe>
is supposed to be unique. Fix that accordingly. This way you can distinguish them by their name in the target
.
精彩评论