title: DT does not allow selecting the maximum number of lines
body: <p>I tried to select a maximum number of rows in a <code>DT</code> through a <code>jQuery</code> function. But, it doesn't work. I think I'm using it incorrectly. I put the corresponding id (<code>row_modif</code>) in the function, but even then it doesn't select 5 lines at most.</p>
  <p>My code:</p>
  <pre><code>library(shiny)
  library(DT)
  
  ui &lt;- basicPage(
    
    mainPanel(
      HTML(
        &quot;&lt;script&gt;
        
  $(document).ready(function() {    
  $('#row_modif').dataTable( {
          'bPaginate': true,
          'bLengthChange': false,
          'bFilter': true,
          'bSort': true,
          'bInfo': true,
          'bAutoWidth': false
      } );
      /* Add/remove class to a row when clicked on */
      $('#row_modif tr').click( function() {
          if($('.row_selected').length &lt; 6 || 
             $(this).hasClass('row_selected')) {
              $(this).toggleClass('row_selected');
          }
      } );
   } );
   $('#row_modif').css('min-height','300');  
  
  $('.btn_r').click(function(){
    $('.row_selected').removeClass('row_selected')
  });
      &lt;/script&gt;&quot;
      ),
      DT::dataTableOutput('row_modif'),
      tags$p(&quot;Selected Row:\n&quot;),
      textOutput(&quot;selectedrow&quot;), 
      tags$p(&quot;Species and Sepal Length for Selected Row:\n&quot;), 
      DT::dataTableOutput(&quot;sscols&quot;)
    ))
  
  server &lt;- function(input, output, session) {
    
    output$row_modif &lt;- DT::renderDataTable({
      
      DT::datatable(data = iris)
        
    })
      
      output$selectedrow &lt;- renderPrint({sort(x = input$row_modif_rows_selected)})
      
      output$sscols &lt;- DT::renderDataTable({
        
        datatable(
          data = iris[sort(input$row_modif_rows_selected), c(&quot;Species&quot;, &quot;Sepal.Length&quot;)],
          options = list(
            pageLength = 8,
            buttons = list(list(
                extend = &quot;csv&quot;,
                filename = &quot;Consulta&quot;,
                fieldSeparator = &quot;;&quot;
              )), dom = 'Blfrtip'), extensions = 'Buttons'
        )
        
      })
    
  }
    
  shinyApp(ui, server)
  </code></pre>
  <p>How to adjust this function so that the <code>DT</code> allows selecting only 5 lines at most?</p>