Jquery, take away 5 from this number

Hi all,

I’ve got a code that calculates the amount of <li> tags are produced but I’m looking to do a sum ; total amount of <li> take away 5…

 source: projects,
               open: function( event, ui ) {
                var len = $('.ui-autocomplete > li').length;
    console.log('Founded '+len+' results');
				   console.log( $( "#this" ).html('There are '+len+' results') ) 
				   $( ".ui-menu-item:nth-child(5)" ).append( '<li class="more_results"><div>There are '+len+' results <a href="">view all courses</a></div></li>' );

Is anyone able to point me in the right direction please?

If you want html tags inline in your text, you need to put a backtick (`) before and after.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.