In my project i'm drawing the design by using jQuery while runtime,
- $("#chkotherOwnPropY").click(function () {
- var str = "";
- str = str + ' ' +' +
- '
' +' +- '
' +' +- '' +
- '
- '
- '
' +' +- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
- '
- '' +' +
- '
' +' +- ' ' +
- '
- '
' +' +- ' ' +
- '
- '
' +' +- ' ' +
- '
- '
- '
- '' +';
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +'- '
' +' +- '
+Add' +- '
- '
- '
- '
- $("#yesDetailsDiv").empty();
- if ($("#yesDetailsDiv").is(':empty')) {
- $('#yesDetailsDiv').append(str);
- }
- });
The above code works fine. An ADD button is introduced to add extra details if the user needs.
I need to display the same design if the user click add button, so i coded for this
- $("#AddDetails").click(function () {
- var str4 = "";
- str4 = str4 +
- ' ' +' +
- '
' +' +- '
' +' +- '
- '
- '
' +' +- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
' +' +- '' +
- '
- '
- '
- '' +' +
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
- '
- '' +' +
- '
' +' +- ' ' +
- '
- '
' +' +- ' ' +
- '
- '
' +' +- ' ' +
- '
- '
- '
- '' +';
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
' +' +- '' +
- '' +
- '' +
- '
- '
- '
- $("#yesDetailsDiv").append(str4);
- });
but here the click function is not working. and i have tried
- $('#AddDetails').live('click',function(){
- (document).on('click', '#AddDetails', function () {
Why click function is not triggering here?
how can i solve this?


Sreekanth ReddyRank #726 · 3.2K reputationPosted Mar 9, 2016, 8:47 PM EST
ali tuncerRank #1,499 · 1.1K reputationPosted Mar 9, 2016, 8:55 PM EST
$("#chkotherOwnPropY").click(function () {
//your code
});
$("#AddDetails").click(function () {
//your code
});
});
Monica Bundel100 reputationPosted Mar 9, 2016, 9:01 PM EST
Monica Bundel100 reputationPosted Mar 9, 2016, 9:01 PM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Mar 9, 2016, 9:25 PM EST
- $('#AddDetails').live('click',function(){
this is correct.