Re: Using DOM to replace media attribute in the link tag on page load

David Perrell wrote:
>  Jonathan: |         mediaType.item(x).setAttribute("media", "all"); ^^^
>  should be: mediaType.item[x].setAttribute("media", "all");

The original code was correct. |mediaType[x]| (not |mediaType.item[x]|) 
is an ECMAScript alternative.

David Perrell wrote:
>  Are you changing multiple stylesheet links? Simpler to give the link
>  element an id and use getElementByID().

That would be |getElementById| (with a lowercase ā€œdā€).

Received on Tuesday, 22 July 2008 09:47:14 UTC