www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23

Thread: Get all elements by id or tags

  1. #16
    Join Date
    Dec 2010
    Posts
    63
    nevermind. error.
    Last edited by JavaScriptNick; 01-12-2011 at 11:01 AM. Reason: Error

  2. #17
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by nmyster View Post
    unless im makingg some stupid mistake
    You did. You forgot to close the function with the end curly bracket
    Code:
    function updateElement(color,node,change,tag) {
    var allDivs=document.getElementsByTagName('a'), i=0,d;
    
    while(d=allDivs[i++])
    {
    	if(d.getAttributeNode('link'))
    	{
    	d.style.color= '#'+color
    	}
    
    }
    } // you forgot this one

  3. #18
    Join Date
    Dec 2010
    Location
    UK
    Posts
    12
    Kor, I knew You'd point that out I missed it out when I copied and pasted the code, it is there.

    JavascriptNick, the cutom attribute is link. so on my links ill put <a href="whatever" link="yes">

    Maybe im miss understanding what your saying.

    Thanks
    Neil

  4. #19
    Join Date
    Dec 2010
    Posts
    63
    You got it right. I'm anxious to see the completed product. Please post a link when you are finished.

    Cheers,
    Nick

  5. #20
    Join Date
    Dec 2010
    Location
    UK
    Posts
    12
    PRESSSUURREE :P

    I shall if I get it working how I have imagined.... I dont want to have to make a exact copy of a function for each element I want to change if possible but if thats what I need to do, then thats what I need to do

    Thanks
    nmyster

  6. #21
    Join Date
    Dec 2010
    Location
    UK
    Posts
    12
    I have isolated the problem to the line:

    d.style.change= '#'+color

    change being a parameter such as color or backgroundColor...

    So, I am thinking, I will make a function for each type of change.. although that may end up alot... so, color backgroundColor border color (if possible) and others when i think of them

    hmmm

  7. #22
    Join Date
    Dec 2010
    Location
    UK
    Posts
    12
    I have had some success with the "application", when it looks sexy and works nicely i'll show you guys

  8. #23
    Join Date
    Dec 2010
    Location
    UK
    Posts
    12
    Hi there.

    My page generator is now complete.

    Try it out at: http://www.nmyster.com/pagegenerator

    It requires you to login to access the generator. Use username: SampleSimon and password: password this is just for trial purposes and Will remove this user soon but wanted to let you try it out.

    The page was designed to allow you to VERY basically design your own website, well the colour scheme anyway. So fiddle around with the colours and then hit generate at the top.

    Let me know what you think and thanks for the help

    Thanks
    nmyster

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles