I found this solution to a problem I was having. But I need to turn it into an onclick function, but I can\'t really do that if I don\'t understand what the code is actually