To select a particular radio button on page load using JavaScript, you can use the onload
event handler to call a function that selects the button you want. Here's an example:
560 chars20 lines
In this example, the selectRadioButton()
function is called on page load. It selects the second radio button by index and sets its checked
property to "true"
, effectively selecting it. You can customize this function to select any radio button you want by changing the index value.
gistlibby LogSnag