adding an id and class to ul with jquery -


How do I add a square and an ID for main ul in a div?

  & lt; Div id "navcont" & gt; & Lt; Ul & gt; & Lt; Li & gt; A & lt; Ul & gt; & Lt; Li & gt; Sub A & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; Two & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; Use only a hair selector:  
  $ ('# Navcont & gt; ul') AddClass ('theClass'). Etter ('id', 'theID');    

Comments