0

I'm trying to make my radio buttons look like normal buttons - how would I do that? I have seen a lot of other questions regarding this but i am not able to get a definite answer. This is what I have tried:

<input name="question${questionNumber}" id="q&a" class="press" type="radio" value="${letter}"><label for="q&a">${letter}</label>

However, my javascript code is not logging it and I am still having to click the radio button for the javascript to recognise that I have clicked the button and it's value is only found if I click a radio button. How do I solve this issue?

Pradhay
  • 41
  • 6
  • Your snippet is not complete and does not include javascript or css. Could you perhaps add a code pen example with these things with what you have tried? – Achtung Jul 20 '20 at 22:15
  • This is a definite answer: [Making radio buttons look like buttons instead](https://stackoverflow.com/questions/16242980/making-radio-buttons-look-like-buttons-instead) No worries happy to help – Always Helping Jul 20 '20 at 22:17

1 Answers1

0

Why use a radio button at all if you want it to look like a normal button? Radio buttons are for selecting 1 option out of many, like in a multiple-choice test. Their design reflects this purpose and most people know how to interact with radio buttons when they see them. If you use a normal button, you can use

Element.addEventListener(“click” function() {
    // do your stuff
})
Lebster
  • 289
  • 5
  • 12
  • The OP is not asking for `click` function. BUT rather CSS the `radio` into a `button`. Your answer has nothing to do with the question. – Always Helping Jul 20 '20 at 22:19