Put two copies of the alert() call inside the if statement, one before the style assignment and one after. I think you'll find that the second doesn't happen, for any of several reasons:
- The variable
myBox doesn't exist
myBox has a value that is not an ID of a valid DOM element
myBox does name a valid element, but it is not a block type element, so padding doesn't apply
You can also try running the same code in another browser with a solid JS debugger, like Firefox + Firebug or Safari with the Develop tools enabled. (Preferences | Advanced.) This may lead you to the problem with that style assignment faster.