hi list
I try to access the innerHTML of  a list to change it's content to
links with wich I wand to insert the text of the list to an input
field.

the code looks like this:
<input name="Categories" class="listcomplete" value="Cat1 Cat2 Cat3">
<ul>
   <li>Cat1</li>
   <li>Cat2</li>
   <li>Cat3</li>
   <li>Cat4</li>
   <li>Cat5</li>
 </ul>

list items should change to:
   <a href="javascript:updateInputField('inputname', 'Cat1')">Cat1</a>


So I need an array of all list items. This so var I could  like this.

function setLinks()
{
  $("input.listcomplete ~ ul > li").each(function(i){
   ...
  }
}

but first I need the name of the text input (Categories) cause I need
it to pass to the function in the link. So I split the each above into
two arrays. First to get the name of the input and the secound each to
go true the li elements. Now I cant figure out how to define the
secound selector properly:
    .this.$("~ ul > li").each(function(i){;

in the function below:
function setLinks()
{
  $("input.listcomplete").each(function(i){
    ....
    .this.$("~ ul > li").each(function(i){;
      .this.html("li with link")
      });
    });
  }


could anyone give me a hint how to do it
tanks nos





Reply via email to