clonetrooper9494 Posted November 12, 2007 Share Posted November 12, 2007 I have this one page where you click either the image, or a radio in order change some thing... but if you click the image, the radio doesn't get checked with the little dot!I know how I am going to fix this, except I don't know if there is a way to do that or if there is a way... I have: <script>function setcolor00(value_2be_changed, radio_id_2be_checked){document.getElementById(...).value = value_2be_changed;radio_id_2be_checked = ???;//(EX: document.getElementById('radio1').??? = ???;)}</script> What should those question marks be to make radio1 become checked? Link to comment Share on other sites More sharing options...
Ingolme Posted November 12, 2007 Share Posted November 12, 2007 If what you want is to check the radio button_document.getElementById('radio1').checked = "checked"If you want a radio button to be checked when you click an image you can do this:<input type="radio" id="radio1" name="something" /><label for="radio1"><img /></label><input type="radio" id="radio2" name="something" /><label for="radio2"><img /></label> Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted November 12, 2007 Author Share Posted November 12, 2007 All I needed was the checked = checked thing... WOW should have googled it...and if you fell like answeringWhat does the lable stuff mean? Link to comment Share on other sites More sharing options...
Ingolme Posted November 12, 2007 Share Posted November 12, 2007 The label tag makes a checkbox or radio button get selected when you click on "something". That something being what's inside the label tag:http://w3schools.com/tags/tag_label.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.