Wilmar Arias
Wilmar Arias

Reputation: 306

How can i get The Html Object in a Event on Bridge.net C#?

in Bridge.net i can only create a defult eventlistner. In javascript i will do it like this.

<div id="nose" onclick="Test(this);"></div>
<script>
    function Test(htmlelement) {
        var id = htmlelement.id;

        console.log('area element id = ' + id);
    }
</script>

Upvotes: 1

Views: 161

Answers (1)

Wilmar Arias
Wilmar Arias

Reputation: 306

I fixed that this way.

public Static void SomeFunc(){

                var label = new HTMLLabelElement();
                label.TextContent = txtbox.Value;
                label.Style.FontSize = "40px";
 label.AddEventListener(EventType.Click,ClickEvent );

}

    public static void ClickEvent (Event e)
            {
                var x = (HTMLElement)e.Target;
               x.SetAttribute("value", "HelloWorld");
            }

Upvotes: 1

Related Questions