Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2011
    Posts
    186
    Thanks
    0
    Thanked 1 Time in 1 Post

    Can I give the <ul> tag an id and value, then extract value with getElementById()?

    I recently learned that only <li> tags can be nested directly inside <ul> tags, and any other tags that I want to make part of the list must be placed inside one of the <li> tags.

    I want to write a javascript (ajax) function that assigns an id and a value to the <ul> tag, then uses getElementById() to take that value from that tag, send it to a php script, and place the php response into another <li> tag nested in the same list (<ul> tag).

    My question:

    Can I do this, or do I have to extract from an <input> tag placed within one of the list items (the <li> tag)?

    Can I place the response directly into another <li> tag, or do I have to place it into a tag within the <li> tag?

    Thanks

  • #2
    Regular Coder
    Join Date
    Dec 2011
    Posts
    186
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for your reply.

    The script I have is messy and busy. I wrote it back when I knew a lot less than I do now.

    There is a simple working ajax script buried in all the mess. I'm adding to it and cleaning it up one item at a time to make sure it still works after each thing I add or remove.

    So far so good with the things I've learned in the last 2 days. I'll post it when it does everything I want it to do, and is easy to read.

    Thanks again for your help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •