On Aug 19, 3:29 am, resetstudio <navy...@gmail.com> wrote:
> Hi everybody, how are you?
> I have to save the state of a form in a var before submitting it with
> the whole html, but if I alert the var, I get the original html
> without the updated input fields.
>
> Example:
> I have
> <div>
>     <input type='text' name='test'/>
> </div>
>
> and I fill that field with "hahahah", on $("div").html() i get "<input
> type='text' name='test'/>" and not "<input type='text' name='test'
> value='hahahah'/>".

Likely that varies by browser.

>
> Can someone help me?

jQuery's html method essentially just returns the value of the
innerHTML property of an element. innerHTML is a proprietary IE
property that has been widely copied by other browsers. It has not
been standardised, nor does it have a published specification,
therefore its value is implementation dependant.

You should not rely on innerHTML (or the html method) returning the
same property across browsers where the content is anything other than
trivial. Form controls (or elements that can be form controls) are
particularly problematic.


--
Rob

Reply via email to