I'm tring to move html element on run time.
(1) Call function from code behind. (Button1_Click1 event)
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "myfunction", "testFunc(100,200);", true);
(2) It redirect to JS function. (This function is used to change the location of html attribute)
function testFunc(x,y) {
document.getElementById('draggable').style.top = x;
document.getElementById('draggable').style.left = y;
}
in number 2, if add alert, it's working properly. (It means function is executing successfully)
But html div is not changing. What could be the problem?
This is my HTML code.
<div>
<b>This is test page<br />
</b>
<div id="draggable" class="ui-icon-image">
<img id="img1" src="/Resource/location_icon.png" width="27px" height="45px" />
</div>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click1" />
</div>