dongtuan1594 2014-03-06 04:51
浏览 103
已采纳

如何使用jQuery将一个隐藏字段的值设置为另一个隐藏字段?

I'm using PHP, Smarty, jQuery(jquery-1.7.1.min.js), AJAX, etc. Following is my HTML code:

<input type="hidden" id="que_id" name="que_id" value=76539 />

I'm having another input of type hidden as follows:

<input type="text" name="question_id" id="question_id" value=""/>

Now what I want to achieve is when the page loads completely, set the value of first input hidden field to the second hidden input field. How should I do this?

  • 写回答

8条回答 默认 最新

  • douna2014 2014-03-06 04:53
    关注

    Simple:

    $(document).ready(function() {
        $("#question_id").val($("#que_id").val());
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?