Welcome to Crack The Code

Firt things first... The CSS for this project is super crappy. We know that's the first thing that came to your mind, but please don't focus on that, because neither did we. This Crack the Code project is primarily focus on the JavaScript part where all the magic happens.
Crack the Code are the puzzles in which there is a lock that has 3 digit key to open it. There are 3 digit hints given and it is told how many of these three digits are correct. If these numbers are correct then how many of these correct numbers are correctly placed.