How to create a jQuery/javascript function to:
- Insert its value into an input box (male/female)
- Change its background and the background of its sibling button to show whether it’s active?
Here is my HTML for a start:
<input type="button" class="ts" id="female" onclick="???????????" />
<input type="button" class="ts" id="male" onclick="???????????" />
<input class="req-string bx long" type="text" id="gender" name="gender" />
Here is an example which will direct you on the right path. It doesn’t do what you are asking, but you will get the idea.
The code below would disable the other button: if you click on “female” it will disable “male” and vice-versa.