Dustin Boswell
Dustin Boswell

Reputation: 31

document.getElementById working differently on iPad Safari?

I'm getting completely different behaviors in mobile Safari on the iPhone versus the iPad, both on actual hardware and in the iOS simulator, for document.getElementById.

This works on mobile and desktop but not on the iPad:

var foo = document.getElementById('foo');
foo.innerHTML = 'bar';

Actually, setting foo.[anything] isn't working on the iPad.

Website: https://davero.com/order2

Banging my head bloody. All help will be appreciated.

Upvotes: 1

Views: 1583

Answers (1)

user3746822
user3746822

Reputation: 21

Are you using safari on the desktop to? Safari has had a problem before where it will return null or undefined back instead of the object. Try using jQuery instead which would look like $('foo'); It would also be really helpful if you could post your code or atleast where you tagged foo and your script.

Upvotes: 1

Related Questions