• Hey.

    I’m building a form and currently I have innerhtml to write the price of pizza when the user clicks the radio button (onclick) however all the prices stay there.

    Is there a way of which when the user clicks 1 radio it button it clears the innerhtml of one price and then displays its price?

    I hope I haven’t confused anyone.

Viewing 1 replies (of 1 total)
  • There is definitely a way, but I may be confused. It would help to see the code of the form you’re working on, and/or a link to the web page with the form, and which element you want affected by the click event of the radio buttons.

    Using jQuery (which WordPress comes with) instead of straight javascript will make it easier, too, most likely.

    In general, you usually use an id attribute on the element you want to change, or a class attribute if there are multiple elements you want to affect.

Viewing 1 replies (of 1 total)
  • The topic ‘Clear innerhtml when user clicks radio button?’ is closed to new replies.