1

When I run this code

var button=document.getElementById("button")

if (navigator.userAgent.indexOf('iPhone') != -1)
{
button.style.left = 250;
}

The error is result of expression is not an object. The object "button" is in the css file and it is the only one named button. What am I doing wrong? Does it have something to do with the button being in the header? I'm using dashcode.

davis
  • 1,911
  • 6
  • 26
  • 50

1 Answers1

0

Try

var button=document.getElementById("button").object

getElementById gives you the HTML DOM node for the button; you have to access its object to do all of the fancy Dashcode stuff to it. (I stumbled around with the same question for a while!)

bdesham
  • 15,430
  • 13
  • 79
  • 123