在另一个文件上显示从表单输入的文本 [英] Display text input from form on another file

查看:67
本文介绍了在另一个文件上显示从表单输入的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的是拥有一个可以填写表格的文件,以及某种设置页面.填写表单后,id会显示在另一个文件中的输入.因此,一页输入内容,另一页显示.

what i am trying to do is to have one file with forms that can be filled out, some sort of setting page. When the form is filled out id like to display the input in another file. So one page to put the input and another one to display it.

我已经尝试使用.getElementById做到这一点,从某种意义上说,我可以显示输入,但只能在同一页面上显示.

I already tried to do it with .getElementById, it worked in the sense that i could display the input but only on the same page.

谢谢您的帮助

推荐答案

您可以将表单信息存储到浏览器本地存储中

You can store form info into the browser local storage

  • localStorage.setItem('key', 'value')创建或修改数据
  • localStorage.getItem('key', 'value')访问数据
  • localStorage.removeItem('key')删除数据
  • localStorage.clear()删除所有数据
  • localStorage.setItem('key', 'value') to create or modify data
  • localStorage.getItem('key', 'value') to access data
  • localStorage.removeItem('key') to delete data
  • localStorage.clear() to delete all data

这篇关于在另一个文件上显示从表单输入的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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