As the title expresses, I wish to turn a radio button <input type="radio">
into an image, while still having the function of selecting it, changing the image. Here is an example (The code is in Svelte but its pretty much vanilla html)
<h2>Select Country to continue</h2>
<form class="white" action="" on:submit={countrysubmit} bind:this={form}>
<label for="US">
<input type="radio" name="US" value="US">
</label>
</form>
</main>
<style></style>
I want the US radio button thing to be an image, that can change while being selected and also have the selection be visible via JS (via .forEach
, looping to find the selected element).