Tuesday, December 13, 2011

Set new value of radiobutton using javascript

 Use this script to set new value of radiobutton using javascript...

function buttonOnClick()
{
 var elementRef = document.getElementById('<%= RadioButton1.ClientID %>');
 var labelArray = elementRef.parentNode.getElementsByTagName('label');

 if ( labelArray.length > 0 )
  labelArray[0].innerHTML = 'Changed label';
}

No comments:

Post a Comment