$('#id').val() = $.cookie("name"); – not works, nothing changes
document.getElementById('id').value = $.cookie("name"); – works fine
Why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are not directly accessing the elements value. The left hand side of your expression is a getter which evaluates to a literal. So the expression is comparable to something like
5 = 10, which obviously cant workval()is overloaded, and by giving it an argument you can reassign