views:

122

answers:

1

This is a .NET program, and I am accessing the HTMLElements individually. There are pieces of markup that have a "More..." / "Less..." in a SPAN tag, that when Clicked will show more/less of the preceding content,

A code snippet:

<dd>
Product Manager, Business Analysis & Web Design Manager, Global Portals at Dun & Bradstreet
<span class="toggle-show-more"> less...</span>
</dd>

The "less.." is click-able, which then invokes something to display less text. I would like to do the same from an HtmlElement programatically.

And, some Command window output from Visual Studio:

OuterHtml: "

<DD collapsed="False">Product Manager, Business Analysis &amp; Web Design Manager, Global Portals at Dun &amp; Bradstreet "
OuterText: "Product Manager, Business Analysis & Web Design Manager, Global Portals at Dun & Bradstreet "

I have tried: elem.RaiseEvent("onlick") and toggling the "collapsed" attribute.

Thank you!

A: 

How about adding an onclick to the span that disappears the dd? Something like:

onclick="this.parentNode.style.display='none'"
Chris Hynes