Set value of hidden input with jquery

前端 未结 7 947
忘了有多久
忘了有多久 2020-12-25 09:03

I\'m trying to set the value of the hidden field below using jQuery.


I\'m using

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-25 09:57

    To make it with jquery, make this way:

    var test = $("input[name=testing]:hidden");
    test.val('work!');
    

    Or

    var test = $("input[name=testing]:hidden").val('work!');
    

    See working in this fiddle.

提交回复
热议问题