Wednesday, April 13, 2011

How to Extract data from html table and list using Jquery map function

According to, map is the name of a higher-order function that applies a given function element-wise to a list of elements and returns a list of results. So it let you to transform the items of a list by applying a given function to each item and returning the list of results.
Jquery API map()
<%@ Page Language="C#" AutoEventWireup="true" 
               CodeFile="test.aspx.cs" Inherits="test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<head runat="server">
    <script src="" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">

        $(document).ready(function () {

            var a = $('#tbl tr').map(function () {
                var $row = $(this);
                return {
                    Num: $row.find(':nth-child(1)').text(),
                    Name: $row.find(':nth-child(2)').text()

            var str = $('#list :checkbox').map(function () {
                return + '-' + $(this).attr('checked');

    <form id="form1" runat="server">
        <table id="tbl">

        <ul id="list">
            <li><input type="checkbox" id="ch1" checked="checked" /></li>
            <li><input type="checkbox" id="ch2" /></li>
            <li><input type="checkbox" id="ch3" checked="checked" /></li>


Carly Fiorina said...

Hello all,

Extracting data from remote sources can be challenging. From a developer's standpoint, data is stored by certain computer and software applications and thus, may not be accessible by third-party tools due to security reasons. Thanks a lot......

Web Scrape

Post a Comment