Q:

changing attribute of a html div tag from asp.net

I have the following <div> in my html page and I want to change its Data-To attribute value from code behind in asp.net
<div id="camp" class="number count-to" data-from="0" data-to="125" data-speed="1000" data-fresh-interval="20"></div>

I have a JavaScript function that sets the value but I'm not able to set its value from code behind in asp.net; my JavaScript function is following...
<script type="text/javascript">

        function myfunc() {
            $('#camp').countTo({ from: 0, to: 100 });
        }
         my func();
</script>

I want to call my func from asp.net.

A:

<div id="camp" class="number count-to" data-from="<%= SomeFromValue %>" data-to="<%= SomeToValue%>" data-speed="1000" data-fresh-interval="20"></div>

Alternatively give it a runat="server" and set it from code behind:
<div runat=server id="camp" class="number count-to" data-speed="1000" data-fresh-interval="20"></div>

Somewhere in code behind:
 camp.Attributes.Add("data-to", "10");
 camp.Attributes.Add("data-from", "1");

