My javascript function looks like this –
function updateSuccess(aEle) {
//Here aEle doesn't have the correct id
percIncrease.innerText = "Success";
}
in realizing it’s bad to get the element this way, what would be a safer way of getting that element?
Some more info –
Here is how I call it from C#..
DropDownList ddl = new DropDownList();
ddl.ID = "ddlData1";
ddl.Attribute.Add("onchange", "updateSuccess('" + ddl.ClientID + "')";
EDIT
As per the edit in your question you just need to do this
javascript
I think you are using javascript with Asp.net for this you can do something like this
Function declration
call to function
or directly like