Reputation: 1197
The following val() call from a textarea is working fine on Firefox/Chrome on my desktop and laptop but on iPhone (safari) nothing is returned? I'm not sure what part of the iOS system stops this from working? Javascript is 'On' in settings.
$('textarea[name=username]').val()
Thanks
Upvotes: 0
Views: 1279
Reputation: 553
If anyone's looking for an answer to this, $().val() doesn't seem to work on iPhone, either as a getter or a setter. Instead, use $().attr('value') like this:
Getter
$('textarea[name=username]').attr('value');
Setter
$('textarea[name=username]').attr('value', 'elonmusk');
Upvotes: 2