Execute SPAN class programmatically from DOM Element?

This is a .NET program and I am referring to HTMLElements

it separately. There are markup snippets that have "More ..." / "Less ..." tags in the SPAN tag when clicking "Clicked" will show more / less previous content,

Snippet of code:

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

      

"less .." has click access, which then calls something to display less text. I would like to do the same from the HtmlElement programmatically.

And, some kind of command line window 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 tried: elem.RaiseEvent("onlick")

and toggled the "sleeping" attribute.

0


source to share


1 answer


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



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

      

0


source







All Articles