Selected Option assistance

Selected Option assistance

Hi,
Im trying to format a particular row based on the option selected from a dropdown list (that has a value of -2).

Ive got the formatting working previously before introducing the rest of the code.

Thanks to Jakecigar its been established that my environment plays with the code but after mucking around with this query for a while now, I was hoping to just check the format & eliminate any issues there before troubleshooting id issues.

Code below, thanks in advance

  1. $(function(){
     
      $("#CategoryID").change(function(){
        var SelectedOption = $("CategoryID:selected");
        if(SelectedOption.val() == -2){
      $("#unknowncategoryrow").css({display: 'block'})
      
     
    })

Todd