fire event inside another event using JQuery

September 30, 2015 0 Comments

In this article i will show you how to fire event inside event using JQuery. I will give an example of it. In this article, first we create a table using JQuery then append the table with the dynamically created table. First, we get the column of the table for inside event then generate function on table row. Lets check the example.

Source code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="browserdetails.aspx.cs" Inherits="browserdetails" %>

<!DOCTYPE html>

<html xmlns="">
<script src=""></script>

        $(function () {
            $("#btncreate").click(function () {
                var newtable = '<table id="mytable"><tr><td>Column1</td><td>Column2</td></tr><tr><td>Row11</td><td>Row12</td></tr></table>';

                var tblid = $("#tbcontainer table").attr("id");
                $("#" + tblid).on("click", "tr:last", function () {
                    var val1 = $(this).find("td").eq(0).text();
                    var val2 = $(this).find("td").eq(1).text();
                    alert(val1 + "  " + val2);

    <form id="form1" runat="server">
    <label id="tbcontainer" />
        <input id="btncreate" type="button" value="button" />

Code Generate the following output
fire event inside another event using JQuery

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google