This is a migrated thread and some comments may be shown as answers.

click event

1 Answer 149 Views
Button
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 09 Jun 2015, 02:48 AM

Hi

How do I pass a value from the button .content

@(Html.Kendo().Button()
                .Name("p14")
                 .HtmlAttributes(new { type = "button" })
                .Content("135")
                       .Events(ev => ev.Click("onClickPol")))
     <script>
    function onClickPol(e) {
       //This dos not work, I want to retrieve the name, content of that button what n this case is 135
        var xContent  = $(e.event.target).closest(".k-button").attr("textContent")

    }
    </script>

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 09 Jun 2015, 12:20 PM

Hello Andrew,

If you would like to access the text content of the button, you could directly use jQuery.

this.wrapper.text()

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Button
Asked by
Andrew
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or