I have a jQuery code which I need inprototype. How can I rewrite this with help of prototype ? <script> $('#select-custom-group').on('change',function(){ if( $(this).val()==="K"){ $(".nobr").show() } else{ $(".nobr").hide() } }); </script> Code (markup):
Try this... Prototype uses $ for id based selection. jQuery $ = CSS based selector (=$$ in Prototype) <script> $('select-custom-group').on('change',function(){ if( $(this).val()==="K"){ $(".nobr").show() } else{ $(".nobr").hide() } }); </script>