从弹出窗口到文档的 jquery 操作

发布于 2024-12-27 15:50:37 字数 91 浏览 3 评论 0原文

我有一个问题。我构建了我的网络应用程序,我需要用按钮打开弹出窗口。 当用户单击按钮时,应用程序必须更改文档中的文本(而不是弹出窗口中)。

有人有主意吗?

I have a question. I build my webapp, and i need to open poupup with buttons.
When user clicks on button app must change text in document (not in popup).

Anyone have a idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

絕版丫頭 2025-01-03 15:50:37

您的弹出窗口仍将是文档的一部分。您将使用 css 隐藏弹出窗口,然后单击某个内容,您将像这样打开它

$('#yourpopupid').toggle();

接下来,单击弹出窗口中的按钮,您只需更改页面上另一个 id 或类的内容,如下所示:

$('#yourmainpageidtobechanged').html('contenthere');

就这样!

Your pop up will still be a part of the document. You will hide the popup with css, and then on click on something you will open it like this

$('#yourpopupid').toggle();

Next, on click of the button in the popup you just change the content of another id or class on your page like this:

$('#yourmainpageidtobechanged').html('contenthere');

That's all!

酒与心事 2025-01-03 15:50:37

查看

window.opener.getElementById('yourDivID').innerText = "Hello World";

Check

window.opener.getElementById('yourDivID').innerText = "Hello World";
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文