Setting hidden field value with Jquery $('#id').attr("value", 'val'); not working in IE

hidden-field, jquery

Solution

You need to pass value to val() jquery function,

$('#id').val("your value");

Problem

I noticed that IE doesnt fill the value of a hidden field, using the code below, while Chrome and FF have no problem with this. ``` $('#id').attr("value", 'val'); ``` I tried a few other things like `.setAttribute` or `.val() = "val";`

Original source