I have designed an HTML structure to switch payment methods.
<ul id="checkout-method">
<li><input name="payment_method" type="radio" value="Cash on Delivery" checked>
<label>Cash on Delivery</label>
<p class="explainpaymethod">Pay with cash upon delivery.</p>
</li>
<li><input name="payment_method" type="radio" value="Paypal">
<label>Paypal</label>
<p class="explainpaymethod">Pay via PayPal; you can pay with your credit card if you don’t have a PayPal account.</p>
</li>
</ul>
However, I am unsure how to achieve the following:
Ensure that the first
input
is always checked by default.Allow users to click on the parent
li
tag to select the radio button.Show the relevant
.explainpaymethod
when one payment method is selected, and hide the others.
Thank you for any assistance provided.