如何消除多次列出href属性所产生的冗余? (唯一改变的是URL中的id名称/值对)HTML是:消除多次列出href的冗余
<!DOCTYPE html>
<html>
<body>
<div style="border: 2px solid lightgrey;"><iframe name="map" width="100%" height="700" frameborder="5px" scrolling="no" marginheight="0" marginwidth="0" src="https://peachtreecorners.maps.arcgis.com/apps/webappviewer/index.html?id=3bee"></iframe></div>
<p><a href="https://peachtreecorners.maps.arcgis.com/apps/webappviewer/index.html?id=2c48" target="map">Do I live in Peachtree Corners?</a></p>
<p><a href="https://peachtreecorners.maps.arcgis.com/apps/webappviewer/index.html?id=270c" target="map">Voting Districts</a></p>
<p><a href="https://peachtreecorners.maps.arcgis.com/apps/webappviewer/index.html?id=ba01" target="map">Apartments and Subdivisions</a></p>
</body>
</html>
在此先感谢!
听起来不粗鲁,但我没有看到任何错误 - 这些链接到不同的页面,因此是分开的。任何使用JS的尝试都会使事情复杂化和混淆。 – Scott
_“(唯一改变的是URL中的id名称/值对)”_注意,每个“”元素的'.innerHTML'也是不同的。 – guest271314