0

I would like to insert a br after the first UL element I have used both after and insertAfter but it inserts it multiple times. thanks in advance

 <div id="usual1">
<ul class="tabs1">
<li><a href="#Home" class="selected">Home</a></li>
<li><a href="#NewPages" class="">NewPages</a></li>
</ul>
<div id="NewPages" style="display: none;">
</div>
</div>
1
  • Although you may use this in SharePoint, it really belongs on StackOverflow.com. You'll get more and better answers there as well. Jun 1, 2011 at 6:08

1 Answer 1

1

This will work, but you'll undoubtedly need to tighten the selector. $("ul:first").append("<br/>"); You haven't given enough specifics for this to be the exact *emphasized text*answer, but hopefully it'll give you the idea.

2
  • Thanks marc since there are a lot of ul's on the page that won't work so what i did is added a id=header to the UL like so : <ul class="tabs1" id="header"> then did $("#header").append("<br/>"); but that added br immediately after the UL and i want it at the end of </UL> <div id="usual1"> <ul class="tabs1"> <li><a href="#Home" class="selected">Home</a></li> <li><a href="#NewPages" class="">NewPages</a></li> </ul> <div id="NewPages" style="display: none;"> </div> </div>
    – Patrick
    Jan 14, 2011 at 3:26
  • Patrick, I can't seem to reconcile your example markup above with what you are trying to do. Could you add some indication where in the markup you want the <br/>? However, this might be solved better with a CSS margin or the like. Jan 15, 2011 at 5:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.