$('#id').value is undefined

前端 未结 3 1927
北海茫月
北海茫月 2021-01-24 06:06

I am having trouble with trying to check the length of a field and set a value based on the result. Using firebug with firefox I keep getting the error \'elUsername\' is not def

3条回答
  •  北海茫月
    2021-01-24 06:10

    try this

    var elUsername = $('#usernameInput').val();
    

    Instead of

    var elUsername = $('#usernameInput').value;
    

提交回复
热议问题