0

I am a beginner in web development. I need something like this:  above it

Images that behave like checkboxes, one selected at a time.

How can I make it?

Ghost
  • 735
  • 5
  • 16
operloa
  • 135
  • 1
  • 7
  • 2
    Hey, this is not a code writing community, please, try to do something yourself, we can help you if you fail. Thats how you learn – VladislavChudak Jul 07 '20 at 20:09

1 Answers1

1

To answer this in simplest form:

  1. Have each image and it's description inside a DIV with a specific class, say "imageBox"
  2. Assign an ID to each of these DIVs
  3. In your stylesheet create a class, say "borderForImageBox" that will have the border to be shown for the selected item
  4. Write a code to capture .click on all DIVs with class "imageBox", where first you will remove class "borderForImageBox" from all DIVs with class "imageBox", and then add class "borderForImageBox" only to the DIV clicked using $(this). Also, append $(this) DIV with the checkbox image
Alwaysa Learner
  • 496
  • 3
  • 11