0

I have a div on my webpage that I am populating with an AJAX call, I can reference elements in jquery already event.preventdefault() and that works great.

However I am trying to select an element now as apposed to having the page respond to the click event and I am getting a reference error, I believe this is due to propagation, I have no idea how a should construct my statement, to correct the problem. here is my function

//show signiture new tab  
$( "#main" ).on( "click", "#POD", function( event ){    
    event.preventDefault();
    window.open('images/DATACAPTURE/' + $("#signiture").attr("data-signiture", value)  + '.BMP', '_blank');                 
});    

it's doesn't like the #signiture I have an id with signiture and it has an attribute data-signiture

j08691
  • 204,283
  • 31
  • 260
  • 272
user2247671
  • 243
  • 1
  • 5
  • 14

1 Answers1

2

You are using the setter version of attr() by passing a second parameter.

I think you mean to use the getter version:

$( "#main" ).on( "click", "#POD", function( event ){
    event.preventDefault();
    window.open('images/DATACAPTURE/' + $("#signiture").attr("data-signiture")  + '.BMP', '_blank');
});
George
  • 36,413
  • 9
  • 66
  • 103