/    Sign up×
Community /Pin to ProfileBookmark

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..

[COLOR=”Blue”]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] = “[COLOR=”Red”]<ul><li><a href =’test1.html’>Werkwijze</a></li>[/COLOR] <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>[COLOR=”Red”]</ul>[/COLOR]“;
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;[/COLOR]

Can someone help me out what i’m doing wrong ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@BIOSTALLJul 06.2011 — 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
×

Success!

Help @stingone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...