<div>Hello,</div>I&#39;m using a jQuery ajax script to toggle the display of a component. The anchor is initially displayed with a &#39;+&#39; png image. When clicked the hidden div is toggled and the anchor image is changed to a &#39;-&#39;. My code works, but I suspect it is not elegant. What I&#39;d like to do to change the anchor image on each click (and the title), rather than the component replacement I&#39;m doing now.  I tried toggling the class of the anchor div to show different background images, but I could not get that to work (it feels like it should be easy).<div>
<br></div><div>Here is what I&#39;m doing now... (&#39;entireContact&#39; is a pre-formatted view of all contact fields in a contact list application).</div><div>I&#39;d prefer a solution that does not use a server call, which the #html: method requires.</div>
<div><br></div><div>Thanks for any help,</div><div>Bob</div><div> </div><div><br></div><div><div>renderContactToggleOn: html</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>html div id: &#39;contactToggle&#39;; with: [</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>self renderContactMoreOn: html].</div></div><div><br></div><div><br></div><div><div>renderContactMoreOn: html</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>html anchor </div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>onClick: (</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>html jQuery ajax script: [:s | </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>s &lt;&lt; (html jQuery id: &#39;entireContact&#39;) toggle: 0.3 seconds.</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>s &lt;&lt; (html jQuery id: &#39;contactToggle&#39;) load html: [:r | self renderContactLessOn: r]]);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>title: &#39;Show all contact attributes&#39;; </div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>with: [html image url: TSwaFileLibrary / #morePng].  &quot; + &quot;</div></div><div><br></div><div><div><br></div><div>renderContactLessOn: html</div><div>
<br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>html anchor </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>onClick: (</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>html jQuery ajax script: [:s | </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>s &lt;&lt; (html jQuery id: &#39;entireContact&#39;) toggle: 0.5 seconds.</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>s &lt;&lt; (html jQuery id: &#39;contactToggle&#39;) load html: [:r | self renderContactMoreOn: r]]);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>title: &#39;Hide contact attributes&#39;; </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>with: [html image url: TSwaFileLibrary / #lessPng].  &quot; - &quot;</div>
<div><br></div></div>