How we can achieve to get the value of tooltip of the Radio button in javascript? I tried this method

document.getElementById('<%= rbSelectedIds.ClientID %>').title

but i am getting blank value only. please help me to resolve this issue.

有帮助吗?

解决方案

In ASP.NET radio button and checkbox are renders inside a span control. So when you put tooltip from server side it will apply to span control.

See why its rendering with span from following link. Why does ASP.Net RadioButton and CheckBox render inside a Span?

So you need to find parent element of the control and then you need to get tooltip. Like following.

var sParentElement = document.getElementById("%=rbSelectedIds.ClientID%>").parentElement;
var tooltip = sParentElement.title;
alert(tooltip);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top