JSFiddle - React, Tailwind, and code Playground

by tridip

HTML

<table id='test' border=1><tr><td>hello....</td></tr>
<tfoot>
        <tr class="webgrid-footer">
            <td colspan="6">1 
            <a href="http://localhost:13562/WebGrid_Sample2/Show2?page=2&amp;sort=ID&amp;sortdir=ASC" data-swhglnk="true">2</a> 
            <a href="http://localhost:13562/WebGrid_Sample2/Show2?page=3&amp;sort=ID&amp;sortdir=ASC" data-swhglnk="true">3</a> 
            <a href="http://localhost:13562/WebGrid_Sample2/Show2?page=4&amp;sort=ID&amp;sortdir=ASC" data-swhglnk="true">4</a> 
            <a href="http://localhost:13562/WebGrid_Sample2/Show2?page=2&amp;sort=ID&amp;sortdir=ASC" data-swhglnk="true"><img src="/images/next.png"></a> 
            <a href="http://localhost:13562/WebGrid_Sample2/Show2?page=4&amp;sort=ID&amp;sortdir=ASC" data-swhglnk="true"><img src="/images/last.png"></a>
            </td>
        </tr>
</tfoot>
</table>

<div id='dv'>

</div>

</diV>

JavaScript

var $elements = $('.webgrid-footer td').contents()
  .filter(function() {
    return this.nodeType === 3 || this.nodeType === 1; // 1 means elements, 3 means text node
  });
  
var $list = $('<ul />');

$elements.each(function(){
//alert($(this).html());
    var $item = $('<li />').append($(this));
    if(!$(this))
    {
    	alert('here is null');
    }
    //alert($item.text());
    $list.append($item);
});
//alert($list.html());
$('#dv').append($list);