i am making a website in php
i make left menu like this

these menu coming from database in one string. i am printing it with echo. i use image as a background to each menu.
now i want like this

i have a arrow image.
i know i can do it with z-index. but i cant do it with only css. so i need a help to do it with javascript. i want to change the html using javascript or jquery