How to trigger on click event to a button which is on a modal window

I am working on an application and need to save modal content into an excel sheet. SO I have created a button 'Export to Excel' and trying to bind on click event . But I couldn't able to . I highly appreciate if any can help out

http://jsfiddle.net/czACy/1/

I have used the following code to trigger :

$(document).ready(function(){
    $('div[id^=modal]').on("show", function(){
        $('div[id^=modal] #excelImport').on('click', function(evt){
            //evt.stopPropagation();
           alert('hello'); 
        });
    });
});

Answers


like this? http://jsfiddle.net/kbypftgv/1/

i think you were too specific with your jquery event nesting

$(document).ready(function(){
    $('div[id^=modal] #excelImport').on('click', function(evt){
        console.log('click');
        alert('hello'); 
    });
});

Need Your Help

Reflection - get method for a nullable<datetiime>

c# reflection db2

While there are similar questions in Stackoverflow about this it does not help me with my problem.

Can SDIO cards be in a shared bus topology

embedded sd-card mmc

I know MMC cards can share a bus and it seems like it should work with SD/SDIO cards as well. However, I've found conflicting information on the web and the simplified specs at sdcard.org talk about

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.