简体   繁体   English

单击第一页的链接后如何更改第二页div的背景颜色

[英]How to change the background color of a div on 2nd page once the link from 1st page is clicked

Once the change color link is clicked i need to redirect to page2.html with a background color change in the particular div using javascript. 单击更改颜色链接后,我需要使用javascript在特定div中使用背景颜色更改重定向到page2.html。

page1.html page1.html

<a href="page2.html id="page1">Change color</a>

page2.html page2.html

<div id="page2>
<h1>color change</h1>
</div>

我认为您可以用当前页面的新背景覆盖第一页背景

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击第一页的锚点时如何替换第二页中的图像? 在 JavaScript - How to replace images in 2nd page when an anchor from 1st page was clicked ? in JavaScript 如何在新页面中打开链接,然后从第二个页面链接回到第一个页面 - How to open link in new page, then link back to the 1st page from the 2nd 链接仅在第一次点击时有效,而从第二次点击开始将不会重定向到href中指定的页面 - link will work only on 1st click and from 2nd click will not redirect to the page which is specified in href 如何将所选日期选择器值从第一页显示到第二页日期选择器 - How to display the selected datepicker value from the 1st page onto the 2nd page datepicker 如何根据从第一个下拉菜单自动更改的第二个下拉菜单更改第二个文本框的值? - How to change the 2nd textbox value based on the 2nd dropdown that is automatically changed from 1st dropdown? 当我单击浏览器中第一页中的按钮时,如何重新加载第二页? - How to reload 2nd page when i click the button in 1st page in browser? 如何在第一个选择上禁用(或更改颜色)第二个下拉选项? - How to disable (or change color) of 2nd drop down option depenging on 1st selection? 我第一页的照片没有传递到第二页 - My photo from my 1st page is not passing down to my 2nd one 如何在页面初始加载时基于第一列表框动态填充第二列表框? - How do dynamically fill 2nd listbox based on 1st listbox on initial load of page? Javascript(Adobe Acrobat XI)从表单第一页输入的答案中填充第二页表单 - Javascript (Adobe Acrobat XI) populate 2nd page form from inputted answers from 1st page in form
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM