supermerc Posted May 21, 2009 Share Posted May 21, 2009 Hi, Im a complete noob at javascript and I have a table with a bunch of images that when you click on them it selects a hidden radio button, however since the radio button is hidden theres no way for the user to see what is selected so I want to have an onclick function that will change the border to lets say 3 pixel and red to show that its selected. Anyone know how to do that? Quote Link to comment Share on other sites More sharing options...
supermerc Posted May 21, 2009 Author Share Posted May 21, 2009 I have this code function selectItem(divid){ var item_border = document.getElementById(divid); var item_box = document.getElementById(divid); if(item_box.checked == true) { item_box.checked = false; item_border.style.border="0px"; } else { item_box.checked = true; item_border.style.border="2px solid #cc0000"; } } But all it does is it selects it, it doesnt change the border :S Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.