Javascript examples for DOM HTML Element:Input Radio
Input Radio checked Property - Use a radio button to convert text in an input field to uppercase:
<!DOCTYPE html> <html> <body> <form> First Name: <input type="text" id="fname" value="Mary"> Convert to upper case/*from w ww. ja va 2 s . c om*/ <input type="radio" onclick="if(this.checked){myFunction()}"> </form> <script> function myFunction() { document.getElementById("fname").value = document.getElementById("fname").value.toUpperCase(); } </script> </body> </html>