更改< div>通过javascript在另一个html文件上的内容 [英] Change <div> contents on another html file through javascript

查看:89
本文介绍了更改< div>通过javascript在另一个html文件上的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两种形式,一种是在我自己的html页面上,我使用javascript来验证输入。



我有另一个名为formok.html的html页面,其中if用户填写的表单有效,然后用户被重定向到formok.html。



在form.html我有一个div,其中

I have two forms, one on its own html page inwhich I use javascript for validation of inputs.

I have another html page called formok.html where if the form that the user is filling out is valid then the user is redirected to formok.html.

In form.html I have a div where the

将请填写apporiate thankyou消息,具体取决于用户填写的格式是否有效。



我的问题是通过javascript如何引用另一个html文件并更改它的分歧?



干杯
will be filled with the apporiate thankyou message depending on which form the user has filled out and is valid .

My question is through javascript how can I reference another html file and change its divcontent?

Cheers

推荐答案

为什么要更改div内容只需创建两个div,隐藏第二个div。在处理/提交的第一个div上执行一些操作点击设置visiblity =trueon second div nad visibility =falsefor first div
why you are changing div content just create two div, hide second div. perform some action on first div on processing / submit click set visiblity="true" on second div nad visibility="false" for first div


这篇关于更改< div>通过javascript在另一个html文件上的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆