I am currently working on a web application using HTML 5, CSS and jQuery. I have an unordered list (ul) for displaying links to pages, with each li element containing a link to the page. This list is created dynamically using jQuery.
I would like the list items to display only the page name in the link, but at the same time keep the full path to the link. For example, "http://www.foo.com/xyz/contactus" will appear as a "contact", but the li element still "knows" the full path of the link. For this, the li value attribute would be ideal, as I could set them like this:
var ul = $('<ul/>').attr('id', 'linkList');
for (var i = 0; i < linksOnPage.length; i++)
{
var pgName = linksOnPage[i].toString().slice(steps[i].toString().lastIndexOf('/') + 1);
var li = $('<li/>').text(pgName);
li.attr('value', linksOnPage[i].toString());
ul.append(li);
}
This will create a list like:
<ul>
<li value="http://www.foo.com/xyz/contactus">contactus</li>
...
</ul>
, value li HTML 4.01 (- ? ...).
, , . - value , , , .
?