Get Input Radio Field - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Radio


The Input Radio object represents an HTML <input> element with type="radio".

You can access an <input> element with type="radio" by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

Radio Button: <input type="radio" id="myRadio">

<button onclick="myFunction()">check the radio button</button>

function myFunction() {/*  ww w  .  ja  va2 s. c om*/
    var x = document.getElementById("myRadio");
    x.checked = true;


Related Tutorials