开发者

How to differentiate two iframes present on the same jsp

开发者 https://www.devze.com 2023-04-13 08:20 出处:网络
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 diff

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号