当使用jQuery显示/隐藏div时,TextBox变得清晰 [英] TextBox Get clear when div show/hide using jquery

查看:74
本文介绍了当使用jQuery显示/隐藏div时,TextBox变得清晰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在一个项目中,我有两个DIV(DIV1,DIV2),两个都没有.动态创建的文本框的数量.
我必须隐藏其中一个DIV.在另一个DIV单击事件中,我将相应地显示这些DIV,然后在DIV1的那些文本框中输入一些文本.当我隐藏此div1并显示DIV2并在DIV2的某些文本框中输入一些文本并将其隐藏时.当我显示DIV1时,文本框为空.我希望这些文本框保留在隐藏之前输入的值. DIV2也会发生相同的情况.
所有这些操作都是通过jquery进行的,我需要jquery的帮助.

任何人都可以帮我吗.
在此先感谢.

Hi all,

I am working on a project in which I have two DIVs (DIV1, DIV2), both have no. of text boxes which are creating dynamically.
I have to hide one of the DIV. On another DIV click event I am showing these DIVs accordingly and enter some text in those textboxes of DIV1. When I hide this div1 and show the DIV2 and enter some text in some textboxes of the DIV2 and hide it. When I show the DIV1 the textboxes are empty. I want these textboxes to retain their values that I entered before I hide it. The same occurs with DIV2 as well.
All these operations are doing by jquery and I need help in jquery.

Can any body help me please.
Thanks in Advance.

推荐答案

假定div1有一个textbox1,而div2有一个textbox2,然后

assuming div1 has a textbox1 and div2 has a textbox2 then


(文档).ready(函数(){
(document).ready(function () {


(' #MainDiv').click(函数(){
('#MainDiv').click(function () {


这篇关于当使用jQuery显示/隐藏div时,TextBox变得清晰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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