Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selected images

Status
Not open for further replies.

macca2424

Programmer
Jul 23, 2007
21
GB
Hi i have 4 images on a page when a image is clicked it just fills a value in a form element ready for submiting, each image has a different value, i have this working fine

what i need to do is, when a image is selected that image shows a border, then if another image is selected the border moves to the new selected image

so not sure how to do it?
 
hi,

i think ur image inside the ancher tag. just put inside the ancher tag.

"style='text-decoration:none;'"


 
yes i have inside a anchor tag but how do i get the border to show when the images is clicked
 
ok i understood ur problem now.

put those images id as sequence like 1,2,3. and call the following method( showBorder(this); ) every image onclick.

function showBorder(img){
for(var i=1;i<images.length;i++){ document.getElementById(i).style.border="1px solid silver";
}
img.style.border="none";
}

reply me if u get.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top