[JS] test: introduce another HTML page to the HTML page. Will the IDs with the same name conflict with each other? jsid

Source: Internet
Author: User

[JS] test: introduce another HTML page to the HTML page. Will the IDs with the same name conflict with each other? jsid

One question asked today is:When another HTML page is introduced into the page HTML page, and exactly two pages have the same ID, do I need to use the ID to handle some behavior conflicts or report errors?

I used iframe to introduce another HTML page.

Prepare materials first: Prepare ). The content of the two pages is as follows:

Test.html:

<! DOCTYPE html> 


Iframe.html:

<! DOCTYPE html> 

Test results:


Result DisplayThe Section font color marked as id = "sameId" in the iframe framework page is not red, so even if another html page is introduced, the two pages have the same id and will not conflict with each other.

PS: This is just a test of embedding another webpage using the iframe method. I haven't tried other methods yet.


Author: Zhizhi

Sign: The road is long, and I will go up and down.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.