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? Link to comment https://forums.phpfreaks.com/topic/159020-solved-onclick-change-image-border/ 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 Link to comment https://forums.phpfreaks.com/topic/159020-solved-onclick-change-image-border/#findComment-838663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.