Jump to content

Hi guys,

I need someone with javascript experience to tell me how I can fill a <ol> or <ul> element with listitems which contain values from an object array.

I would appreciate if this can be done with as little code as possible and little jquery. Thanks for anyone who wants to help.

 

this is my array :

(dutch translation: naam=name, prijs=price, personeel=employees)

 

var behandeling={
        knippen:{
            naam:"knippen",
            prijs:15,
            personeel:["mark","kerim","niels","jan"]
        },
        verven:{
            naam:"kleuren",
            prijs: 20,
            personeel:["mark"] 
        },
        wassen:{
            naam:"wassen",
            prijs: 5,
            personeel:["mark","kerim","niels","jan"]
        },
        brushen:{
            naam:"brushen",
            prijs: 10,
            personeel:["kerim","niels"]
        },
        permanent:{
            naam:"permanent",
            prijs: 15,
            personeel:["niels","jan"]
        }
    };

Link to comment
https://linustechtips.com/topic/587552-javascript-fill-list-with-object-array/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×