dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: LU, LI tag in javascript

  1. #1
    Join Date
    Jul 2011
    Posts
    6

    LU, LI tag in javascript

    Hi All,

    I made some script for some buttons. When clicking on a butten the menu on the left side will change.

    The script works fine, but the bullets are not showing up. I don't know whats wrong..

    var rand = Math.floor(Math.random() * 3);//the number here must be the total number of products you have listed
    var prod = new Array();
    prod[0] = "<ul><li><a href =\'test1.html\'>Werkwijze</a></li> <br><br> <li><a href =\'test1.html\'>Portfolio</a></li> <br><br> <li><a href =\'test1.html\'>Partners</a></li> <br><br> <li><a href =\'test1.html\'>Tarieven</a></li> <br><br><br> <li><a href =\'test1.html\'>Webshop</a></li></ul>";
    prod[1] = "<a href =\'test1.html\'>Werkwijze</a> <br><br> <a href =\'test1.html\'>Portfolio</a> <br><br> <a href =\'test1.html\'>Tarieven</a> <br><br><br> <a href =\'test1.html\'>Webshop</a>";
    prod[2] = "<a href =\'test1.html\'>Werkwijze</a> <br><br> <a href =\'test1.html\'>Portfolio</a> <br><br> <a href =\'test1.html\'>Partners</a> <br><br> <a href =\'test1.html\'>Tarieven</a>";
    function loadProd(content){
    document.getElementById('fullDescrip').innerHTML = content;


    Can someone help me out what i'm doing wrong

  2. #2
    Join Date
    Oct 2005
    Location
    Cambridgeshire, UK
    Posts
    191
    Couple of thoughts:

    1) You're got <br /> tags between your closing and opening <li> tags. This is invalid HTML.
    2) You're escaping single quotes with a backslash when there is no need ne because your string is encased with double quotes.
    3) You're missing a closing } for the loadProp function
    4) What does your CSS look like with regards to unordered lists?

    Cheers

Thread Information

Users Browsing this Thread

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

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