1 <!DOCTYPE html>
2 <html>
3 <style>
4 .container {
5 margin: 20px 0;
6 }
7 </style>
8 <body>
9 <h1>The Input Radio Object</h1>
10 <h2>Example</h2>
11
12 <div id="container" class="container">
13 <input type="radio" id="radio" value="option" />
14 </div>
15
16 <button onclick="access()">Access</button>
17
18 <p id="result"></p>
19 <script>
20 function access() {
21 const element = document.getElementById("radio");
22 const str = `The radio field default value is : <b>${element.defaultValue}</b>`;
23 document.getElementById("result").innerHTML = str;
24 }
25 </script>
26 </body>
27 </html>