title: TypeError: $(...).attr(...) is undefined
body: <pre><code>$('.weight').live('input',function() {
          var t = $(this).attr('id').replace('weight-',''); 
  
          var table_name = $('#table_name-'+t+' option:selected').val();
  
          var quality_color_value = parseFloat($('#quality-color-'+t+' option:selected').attr('data-id').split('\`')[0]);
  
          var diamond_weight = parseFloat($('#quality-color-'+t+' option:selected').attr('data-id').split('\`')[1]);
  
          var diamond_pcs = parseFloat($('#diamond-pcs-'+t).val()); 
  
          if(table_name == 1){ 
             var diamond_weight = parseFloat($('#weight-'+t).val()); 
          }
  
          if(table_name == 2){
              $('#weight-'+t).val(diamond_weight);
          } 
  
      });        
  </code></pre>