jquery how to access data in li

I have list like this

<ul id="list">
    <li url="book/love">Love</li>
    <li url="book/cook">Food</li>
    <li url="book/policy">Policy</li>
    <li url="book/child">Child</li>
    <li url="book/funny">Funny</li>

How i can get data in url of this list?

my script like this

console.log($("#list li").attr("url")[1]); //It's should show **book/cook** but it's return undefined

how i can get this data ?

Answers 1

Related Articles