The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript JQuery adding a span tag after a list item/a tag

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #32039

    I’m having problems trying to add a span tag after an < a > tag in a list. My html looks like:

    And I’d ideally like it to look like this after JQuery has added the span:

    I’m a complete beginner at JQuery and I tried various things after looking at the JQuery tutorials. This is what I thought would work..

    $('li a').add("");

    I’d really appreciate it if someone could tell me if its possible and where I’m going wrong – many thanks :)

    $('li a').append('');

    Thank you! Works like a charm – I’m sure I tried .append but I must have been doing it wrong. Thank you again, really appreciate it :)

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.