如何使用 javascript 获取更新的innerHTML

发布于 2024-09-10 05:08:20 字数 396 浏览 0 评论 0原文

我这个页面包含 3 个可拖动的 div。

我正在使用 JQuery 将这些 div 拖动到页面上。

现在当我将它们拖到不同的位置时。

他们的属性值应更改为新位置。

例如,当页面加载第一个 div 值时:

<div style='position:absolute;left:1px;top:1px;'> 

拖动框后,它应该更改为新位置。应该显示更新的innerHTML,但它似乎不起作用。

不,我不想使用 findposition 函数,因为这只是一个示例,我有广泛的属性/对象。

所以我需要的是获取更新后的innerHTML。 有什么方法可以用javascript做到这一点吗?

谢谢

I have this page contains 3 draggable divs.

I'm using JQuery to drag these divs on the page.

Now when I drag them to different positions.

their attributes values should be changed to the new positions.

for example when the page loads the first div value:

<div style='position:absolute;left:1px;top:1px;'> 

after I drag the box it should be changed to new position. the should show updated innerHTML but it seems not to be working.

and no I dont wanna use the findposition function because this is only a sample and I have wide range of attributes/objects.

so what I need is to get the updated innerHTML of .
is there any way to do this with javascript?

thanks

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

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

发布评论

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

评论(1

卖梦商人 2024-09-17 05:08:20

我使用的是 $.get('page.html', function(response){});

我刚刚将其更改为:

response = document.body.innerHTML;

现在一切都很顺利。

I was using $.get('page.html', function(response){});.

I just changed it to:

response = document.body.innerHTML;

Now everything is workin like charm.

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