I'm attempting to use a click function to alter the CSS code and then run a function. Here is my current code:
ready: ->
$("#titleDD").click ->
$("#titleDD").css('text-decoration', 'underline');
$("#catDD").css('text-decoration', 'none');
$("#catDD").click ->
$("#catDD").css('text-decoration', 'underline');
$("#titleDD").css('text-decoration', 'none');
`console.log("hello2");`
`console.log("hello");`
Upon running the code, hello2 and hello are immediately displayed in the console once the webpage loads. However, when I click on #catDD, neither hello nor hello2 are printed, and the text-decoration of titleDD does not change. Can someone explain why all of the code is not being executed? Thank you.